From 0432b7d50de1e9cc8b56087eccd93d9aad25f890 Mon Sep 17 00:00:00 2001 From: Yonas Habteab Date: Thu, 27 Feb 2020 15:30:05 +0100 Subject: [PATCH] Revert "JS: Do not apply 'menu-hovered' on #layout" This reverts commit 5443bfe9fa02abdff8e785d8c3186e609f317c54. --- public/js/icinga/behavior/navigation.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/public/js/icinga/behavior/navigation.js b/public/js/icinga/behavior/navigation.js index 205216470..7186d9040 100644 --- a/public/js/icinga/behavior/navigation.js +++ b/public/js/icinga/behavior/navigation.js @@ -277,12 +277,17 @@ var $flyout = $target.find('.nav-level-2'); if (! $flyout.length) { + $layout.removeClass('menu-hovered'); $target.siblings().not($target).removeClass('hover'); return; } var delay = 300; + if ($layout.hasClass('menu-hovered')) { + delay = 0; + } + setTimeout(function() { try { if (! $target.is(':hover')) { @@ -290,6 +295,7 @@ } } catch(e) { /* Bypass because if IE8 */ } + $layout.addClass('menu-hovered'); $target.siblings().not($target).removeClass('hover'); $target.addClass('hover'); @@ -319,6 +325,8 @@ var $hovered = $('#menu').find('.nav-level-1 > .nav-item.hover'); if (! $hovered.length) { + $layout.removeClass('menu-hovered'); + return; } @@ -329,6 +337,7 @@ } } catch(e) { /* Bypass because if IE8 */ }; $hovered.removeClass('hover'); + $layout.removeClass('menu-hovered'); }, 600); };