Skip to content

Add menu positioning settings#304

Open
siimha wants to merge 10 commits into
masterfrom
303_menu_positioning_settings
Open

Add menu positioning settings#304
siimha wants to merge 10 commits into
masterfrom
303_menu_positioning_settings

Conversation

@siimha

@siimha siimha commented Jul 13, 2018

Copy link
Copy Markdown
Contributor

Close #303

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

Copy link
Copy Markdown

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

@siimha siimha left a comment

Copy link
Copy Markdown
Contributor Author

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

Comment thread components/menu-settings-editor.tpl Outdated
@@ -0,0 +1,69 @@
{% if editmode %}
<button class="menu-position-settings"></button>

Copy link
Copy Markdown
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

Comment thread components/menu-settings-editor.tpl Outdated
var valuesObj = {};
{% endif %};

var productDescrptionBtn = document.querySelector('.menu-position-settings');

Copy link
Copy Markdown
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

Comment thread components/menu-settings-editor.tpl Outdated
var SettingsEditor = new Edicy.SettingsEditor(productDescrptionBtn, {
menuItems: [
{
"title": "Menu positioning",

Copy link
Copy Markdown
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
Copy Markdown
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.

Comment thread components/menu-settings-editor.tpl Outdated
buttonActiveClass: 'settings-popover-open',

commit: function(data) {
siteData.set('menu_position_settings', data, {

Copy link
Copy Markdown
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

Comment thread sources/javascripts/concat/base.js Outdated
}
};

var togglePositionSettingsLocation = function() {

Copy link
Copy Markdown
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

Comment thread 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');

Copy link
Copy Markdown
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

Comment thread 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',

Copy link
Copy Markdown
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

Comment thread javascripts/main.js Outdated
};

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

Copy link
Copy Markdown
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

Comment thread components/menu-language.tpl Outdated
<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
Copy Markdown
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
Copy Markdown

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

@siimha siimha left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Mõningased kommentaarid.

Comment thread components/menu-settings-editor.tpl Outdated
},
{
"titleI18n": "always_visible",
"value": "visible-when"

Copy link
Copy Markdown
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"
}
            

Comment thread components/site-header.tpl Outdated
</div>

<div class="header-right js-header-right">
<div class="header-right {{ site.data.menu_position_settings.menu_positioning }} js-header-right">

Copy link
Copy Markdown
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

Comment thread components/menu-settings-editor.tpl Outdated
success: function() {
window.location.reload();
}
});

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Joondus paigast.

Comment thread components/menu-settings-editor.tpl Outdated
<script>
var siteData = new Edicy.CustomData({
type: 'site',
id: {{ site.id }}

@siimha siimha Aug 12, 2020

Copy link
Copy Markdown
Contributor Author

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

Comment thread components/menu-settings-editor.tpl Outdated
"value": "always-visible"
},
],

Copy link
Copy Markdown
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.

Comment thread components/menu-mobile.tpl Outdated
{% if editmode %}
<li class="edit-btn">{% languageadd %}</li>
{% endif %}
{% endif %}

Copy link
Copy Markdown
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

Comment thread javascripts/main.js Outdated
}, 400);
} else {
$('.visible-when').addClass('scrolling');

Copy link
Copy Markdown
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