From f83e30b0ad1e664ee98fb45057b01e2dd44539d6 Mon Sep 17 00:00:00 2001 From: Mikkel Hastrup Date: Thu, 11 Apr 2019 10:56:32 +0200 Subject: [PATCH] [BUGFIX] hovering on dropdownColumns before js has loaded will invert the toggle-effect --- Resources/Public/css/main.js | 6 ++++-- Resources/Public/less/main.js | 6 ++++-- felayout_t3kit/dev/js/main/header/header.js | 6 ++++-- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/Resources/Public/css/main.js b/Resources/Public/css/main.js index 2c62f99e..542f5df6 100644 --- a/Resources/Public/css/main.js +++ b/Resources/Public/css/main.js @@ -14,8 +14,10 @@ jQuery(function ($) { var $dropdownMenuWithColumns = $('.js__dropdown-menu-with-columns .js__main-navigation__item._sub') if (!touchSupport) { - $dropdownMenuWithColumns.hover(function () { - $(this).toggleClass('open') + $dropdownMenuWithColumns.mouseenter(function () { + $(this).addClass('open') + }).mouseleave(function () { + $(this).removeClass('open') }) } diff --git a/Resources/Public/less/main.js b/Resources/Public/less/main.js index 2c62f99e..542f5df6 100644 --- a/Resources/Public/less/main.js +++ b/Resources/Public/less/main.js @@ -14,8 +14,10 @@ jQuery(function ($) { var $dropdownMenuWithColumns = $('.js__dropdown-menu-with-columns .js__main-navigation__item._sub') if (!touchSupport) { - $dropdownMenuWithColumns.hover(function () { - $(this).toggleClass('open') + $dropdownMenuWithColumns.mouseenter(function () { + $(this).addClass('open') + }).mouseleave(function () { + $(this).removeClass('open') }) } diff --git a/felayout_t3kit/dev/js/main/header/header.js b/felayout_t3kit/dev/js/main/header/header.js index 9c645ae4..a39259d7 100644 --- a/felayout_t3kit/dev/js/main/header/header.js +++ b/felayout_t3kit/dev/js/main/header/header.js @@ -12,8 +12,10 @@ jQuery(function ($) { var $dropdownMenuWithColumns = $('.js__dropdown-menu-with-columns .js__main-navigation__item._sub') if (!touchSupport) { - $dropdownMenuWithColumns.hover(function () { - $(this).toggleClass('open') + $dropdownMenuWithColumns.mouseenter(function () { + $(this).addClass('open') + }).mouseleave(function () { + $(this).removeClass('open') }) }