Skip to content

Commit

Permalink
[BUGFIX] Meta navigation hidden when using language menu in main-naiv…
Browse files Browse the repository at this point in the history
…gation. Doesn't reappear when clicking languageMenuOverlay to close it. (#518)
  • Loading branch information
pxamike authored and dmh committed Apr 15, 2019
1 parent a83f289 commit 9bf7fd3
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 12 deletions.
14 changes: 10 additions & 4 deletions Resources/Public/css/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,18 +148,24 @@ jQuery(function ($) {
$mainNavigationSearchBtn.toggleClass('_search-close-btn')
$mainNavigationSearchBox.toggleClass('_search-box-visible')
})

$languageMenuBtn.on('click', function (e) {
e.preventDefault()
$languageMenuBox.addClass('_language-menu-box-visible')
$languageMenuOverlay.toggleClass('_language-menu-box-overlay-visible')
$metaNavigationNav.addClass('hidden')
$languageMenuOverlay.addClass('_language-menu-box-overlay-visible')

// hide meta-navigation if showHeaderTopLangMenu = 1
if ($('.header-top .js__header-top__language-menu-box').length) {
$metaNavigationNav.addClass('hidden')
}
})
$languageMenuOverlay.on('click', function () {
$(this).toggleClass('_language-menu-box-overlay-visible')
$(this).removeClass('_language-menu-box-overlay-visible')
$languageMenuBox.removeClass('_language-menu-box-visible')
$metaNavigationNav.removeClass('hidden')
})
$languageMenuBoxCloseBtn.on('click', function () {
$languageMenuOverlay.toggleClass('_language-menu-box-overlay-visible')
$languageMenuOverlay.removeClass('_language-menu-box-overlay-visible')
$languageMenuBox.removeClass('_language-menu-box-visible')
$metaNavigationNav.removeClass('hidden')
})
Expand Down
14 changes: 10 additions & 4 deletions Resources/Public/less/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,18 +148,24 @@ jQuery(function ($) {
$mainNavigationSearchBtn.toggleClass('_search-close-btn')
$mainNavigationSearchBox.toggleClass('_search-box-visible')
})

$languageMenuBtn.on('click', function (e) {
e.preventDefault()
$languageMenuBox.addClass('_language-menu-box-visible')
$languageMenuOverlay.toggleClass('_language-menu-box-overlay-visible')
$metaNavigationNav.addClass('hidden')
$languageMenuOverlay.addClass('_language-menu-box-overlay-visible')

// hide meta-navigation if showHeaderTopLangMenu = 1
if ($('.header-top .js__header-top__language-menu-box').length) {
$metaNavigationNav.addClass('hidden')
}
})
$languageMenuOverlay.on('click', function () {
$(this).toggleClass('_language-menu-box-overlay-visible')
$(this).removeClass('_language-menu-box-overlay-visible')
$languageMenuBox.removeClass('_language-menu-box-visible')
$metaNavigationNav.removeClass('hidden')
})
$languageMenuBoxCloseBtn.on('click', function () {
$languageMenuOverlay.toggleClass('_language-menu-box-overlay-visible')
$languageMenuOverlay.removeClass('_language-menu-box-overlay-visible')
$languageMenuBox.removeClass('_language-menu-box-visible')
$metaNavigationNav.removeClass('hidden')
})
Expand Down
14 changes: 10 additions & 4 deletions felayout_t3kit/dev/js/main/header/header.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,18 +146,24 @@ jQuery(function ($) {
$mainNavigationSearchBtn.toggleClass('_search-close-btn')
$mainNavigationSearchBox.toggleClass('_search-box-visible')
})

$languageMenuBtn.on('click', function (e) {
e.preventDefault()
$languageMenuBox.addClass('_language-menu-box-visible')
$languageMenuOverlay.toggleClass('_language-menu-box-overlay-visible')
$metaNavigationNav.addClass('hidden')
$languageMenuOverlay.addClass('_language-menu-box-overlay-visible')

// hide meta-navigation if showHeaderTopLangMenu = 1
if ($('.header-top .js__header-top__language-menu-box').length) {
$metaNavigationNav.addClass('hidden')
}
})
$languageMenuOverlay.on('click', function () {
$(this).toggleClass('_language-menu-box-overlay-visible')
$(this).removeClass('_language-menu-box-overlay-visible')
$languageMenuBox.removeClass('_language-menu-box-visible')
$metaNavigationNav.removeClass('hidden')
})
$languageMenuBoxCloseBtn.on('click', function () {
$languageMenuOverlay.toggleClass('_language-menu-box-overlay-visible')
$languageMenuOverlay.removeClass('_language-menu-box-overlay-visible')
$languageMenuBox.removeClass('_language-menu-box-visible')
$metaNavigationNav.removeClass('hidden')
})
Expand Down

0 comments on commit 9bf7fd3

Please sign in to comment.