-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add menu positioning settings #304
base: master
Are you sure you want to change the base?
Conversation
Vajaminevad tõlked settings nupule: Mobiilse vaate seaded - Mobile view settings |
Added mobile menu view settings button for desktop and mobile view. Also added for script window.location.reload(); and removed overflow: scroll from css. Closes #304
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tõlked võiksid panna ka slacki keelepolitsei kanalisse ja kui sealt ka kinnitus, siis tuleks need CMSi lisada
components/menu-settings-editor.tpl
Outdated
@@ -0,0 +1,69 @@ | |||
{% if editmode %} | |||
<button class="menu-position-settings"></button> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kasutada paremat klassi nimetust, näiteks mobile-menu-button-settings
components/menu-settings-editor.tpl
Outdated
var valuesObj = {}; | ||
{% endif %}; | ||
|
||
var productDescrptionBtn = document.querySelector('.menu-position-settings'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kasutada muutujal paremat nimetus, näiteks mobileMenuSettingsButton
components/menu-settings-editor.tpl
Outdated
var SettingsEditor = new Edicy.SettingsEditor(productDescrptionBtn, { | ||
menuItems: [ | ||
{ | ||
"title": "Menu positioning", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kasutada CMSist tulevaid tõlkeid. Selleks kasutada I18 võtmeid nagu on antud PRis.
{ | ||
"title": "Menu positioning", | ||
"type": "radio", | ||
"key": "menu_positioning", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lisada ka tooltip nagu antud PRis.
components/menu-settings-editor.tpl
Outdated
buttonActiveClass: 'settings-popover-open', | ||
|
||
commit: function(data) { | ||
siteData.set('menu_position_settings', data, { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kasutada paremat võtme nimetust nt. mobile_menu_button_settings
sources/javascripts/concat/base.js
Outdated
@@ -194,6 +209,17 @@ | |||
} | |||
}; | |||
|
|||
var togglePositionSettingsLocation = function() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Selle nimetus võiks olla toggleMobileMenuButtonPosition
sources/javascripts/concat/base.js
Outdated
var $positionSettingsMenuElement = $('.js-menu-position-settings'); | ||
if ($(window).width() <= 1024) { | ||
$positionSettingsMenuElement.appendTo('.js-menu-main-mobile'); | ||
console.log($positionSettingsMenuElement, 'smaller then'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Console.log() eemaldada
components/menu-settings-editor.tpl
Outdated
// Title for the button. | ||
buttonTitle: 'Mobiilse vaate seaded', | ||
// Class for the button while Settings Editor is visible. | ||
buttonActiveClass: 'settings-popover-open', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seda klassi ei kasutata vist millekski settings-popover-open
javascripts/main.js
Outdated
@@ -249,6 +264,17 @@ | |||
} | |||
}; | |||
|
|||
var togglePositionSettingsLocation = function() { | |||
var $positionSettingsMenuElement = $('.js-menu-position-settings'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Selle muutja nimetus võiks olla mobileMenuButtonElement
components/menu-language.tpl
Outdated
@@ -26,6 +26,7 @@ | |||
<button class="btn btn-js-styled js-menu-language-settings-toggle js-prevent-sideclick"></button> | |||
</li> | |||
{% endif %} | |||
<li class="menu-item-cms js-menu-position-settings">{% include "menu-settings-editor" %} </li> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Selle nimetus võiks olla js-mobile-menu-button-wrapper
Muutujate ja funktsioonide nimed parandatud. Puudu veel tooltipid ja tõlked. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mõningased kommentaarid.
components/menu-settings-editor.tpl
Outdated
}, | ||
{ | ||
"titleI18n": "always_visible", | ||
"value": "visible-when" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need väärtused on vahetusse läinud:
{
"titleI18n": "always_visible",
"value": "visible-when"
},
{
"titleI18n": "visible_when_scrolling_up",
"value": "always-visible"
}
components/site-header.tpl
Outdated
@@ -11,7 +11,7 @@ | |||
<div class="header-title content-area">{% unless editmode %}<a href="{{ site.root_item.url }}">{% endunless %}{% editable site.header %}{% unless editmode %}</a>{% endunless %}</div> | |||
</div> | |||
|
|||
<div class="header-right js-header-right"> | |||
<div class="header-right {{ site.data.menu_position_settings.menu_positioning }} js-header-right"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
data nimetus peaks olema mobile_menu_button_settings
components/menu-settings-editor.tpl
Outdated
success: function() { | ||
window.location.reload(); | ||
} | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Joondus paigast.
components/menu-settings-editor.tpl
Outdated
<script> | ||
var siteData = new Edicy.CustomData({ | ||
type: 'site', | ||
id: {{ site.id }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lehe datal pole id-d
} | ||
} | ||
|
||
&.visible-when, { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Koma on üleliigne &.visible-when,
seda tuleb kasutada vaid siis kui sihitakse ka mingit muud klassi. Võib kasutada &.visible-when. scrolling { stiilid }
.
components/menu-settings-editor.tpl
Outdated
"value": "always-visible" | ||
}, | ||
], | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Komad üleliigsed objektil ja arrayl. Liigne tühi rida.
components/menu-mobile.tpl
Outdated
@@ -46,7 +46,7 @@ | |||
{% endfor %} | |||
{% if editmode %} | |||
<li class="edit-btn">{% languageadd %}</li> | |||
{% endif %} | |||
{% endif %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Üleliigsed tühikud
javascripts/main.js
Outdated
}, 400); | ||
} else { | ||
$('.visible-when').addClass('scrolling'); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Üleliigne tühi rida
Close #303