Skip to content

Commit bb66922

Browse files
pxamikedmh
authored andcommitted
[BUGFIX] hovering on dropdownColumns before js has loaded will invert the toggle-effect (#510)
1 parent a7142b3 commit bb66922

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

Resources/Public/css/main.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@ jQuery(function ($) {
1414
var $dropdownMenuWithColumns = $('.js__dropdown-menu-with-columns .js__main-navigation__item._sub')
1515

1616
if (!touchSupport) {
17-
$dropdownMenuWithColumns.hover(function () {
18-
$(this).toggleClass('open')
17+
$dropdownMenuWithColumns.mouseenter(function () {
18+
$(this).addClass('open')
19+
}).mouseleave(function () {
20+
$(this).removeClass('open')
1921
})
2022
}
2123

Resources/Public/less/main.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@ jQuery(function ($) {
1414
var $dropdownMenuWithColumns = $('.js__dropdown-menu-with-columns .js__main-navigation__item._sub')
1515

1616
if (!touchSupport) {
17-
$dropdownMenuWithColumns.hover(function () {
18-
$(this).toggleClass('open')
17+
$dropdownMenuWithColumns.mouseenter(function () {
18+
$(this).addClass('open')
19+
}).mouseleave(function () {
20+
$(this).removeClass('open')
1921
})
2022
}
2123

felayout_t3kit/dev/js/main/header/header.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,10 @@ jQuery(function ($) {
1212
var $dropdownMenuWithColumns = $('.js__dropdown-menu-with-columns .js__main-navigation__item._sub')
1313

1414
if (!touchSupport) {
15-
$dropdownMenuWithColumns.hover(function () {
16-
$(this).toggleClass('open')
15+
$dropdownMenuWithColumns.mouseenter(function () {
16+
$(this).addClass('open')
17+
}).mouseleave(function () {
18+
$(this).removeClass('open')
1719
})
1820
}
1921

0 commit comments

Comments
 (0)