Skip to content
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

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open

Conversation

siimha
Copy link
Contributor

@siimha siimha commented Jul 13, 2018

Close #303

@siimha siimha self-assigned this Jul 13, 2018
@siimha siimha added the feature label Jul 13, 2018
@entertthk
Copy link

Vajaminevad tõlked settings nupule:

Mobiilse vaate seaded - Mobile view settings
Menüü asukoht - Menu positioning
Fikseeritud päises (või Lukustatud päises) - Fixed in header
Nähtav ülesse kerides - Visible when scrolling up
Koguaeg nähtav - Always visible

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
Copy link
Contributor Author

@siimha siimha left a 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

@@ -0,0 +1,69 @@
{% if editmode %}
<button class="menu-position-settings"></button>
Copy link
Contributor Author

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

var valuesObj = {};
{% endif %};

var productDescrptionBtn = document.querySelector('.menu-position-settings');
Copy link
Contributor Author

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

var SettingsEditor = new Edicy.SettingsEditor(productDescrptionBtn, {
menuItems: [
{
"title": "Menu positioning",
Copy link
Contributor Author

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",
Copy link
Contributor Author

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.

buttonActiveClass: 'settings-popover-open',

commit: function(data) {
siteData.set('menu_position_settings', data, {
Copy link
Contributor Author

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

@@ -194,6 +209,17 @@
}
};

var togglePositionSettingsLocation = function() {
Copy link
Contributor Author

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

var $positionSettingsMenuElement = $('.js-menu-position-settings');
if ($(window).width() <= 1024) {
$positionSettingsMenuElement.appendTo('.js-menu-main-mobile');
console.log($positionSettingsMenuElement, 'smaller then');
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Console.log() eemaldada

// Title for the button.
buttonTitle: 'Mobiilse vaate seaded',
// Class for the button while Settings Editor is visible.
buttonActiveClass: 'settings-popover-open',
Copy link
Contributor Author

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

@@ -249,6 +264,17 @@
}
};

var togglePositionSettingsLocation = function() {
var $positionSettingsMenuElement = $('.js-menu-position-settings');
Copy link
Contributor Author

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

@@ -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>
Copy link
Contributor Author

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

@entertthk
Copy link

Muutujate ja funktsioonide nimed parandatud. Puudu veel tooltipid ja tõlked.

Copy link
Contributor Author

@siimha siimha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mõningased kommentaarid.

},
{
"titleI18n": "always_visible",
"value": "visible-when"
Copy link
Contributor Author

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"
}
            

@@ -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">
Copy link
Contributor Author

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

success: function() {
window.location.reload();
}
});
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Joondus paigast.

<script>
var siteData = new Edicy.CustomData({
type: 'site',
id: {{ site.id }}
Copy link
Contributor Author

@siimha siimha Aug 12, 2020

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, {
Copy link
Contributor Author

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 }.

"value": "always-visible"
},
],

Copy link
Contributor Author

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.

@@ -46,7 +46,7 @@
{% endfor %}
{% if editmode %}
<li class="edit-btn">{% languageadd %}</li>
{% endif %}
{% endif %}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Üleliigsed tühikud

}, 400);
} else {
$('.visible-when').addClass('scrolling');

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Üleliigne tühi rida

@tanelj tanelj self-requested a review August 18, 2020 08:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add settings for menu positioning
2 participants