From 2d228ce83d4e18f48df0ab6275981879c4197212 Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Thu, 5 Jun 2014 18:11:19 +0000 Subject: [PATCH] JS for IE8: even more JS fixes refs #6417 --- public/js/icinga/events.js | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/public/js/icinga/events.js b/public/js/icinga/events.js index 745441741..e8bfdcfc6 100644 --- a/public/js/icinga/events.js +++ b/public/js/icinga/events.js @@ -120,10 +120,10 @@ $(document).on('mouseenter', '.historycolorgrid td', this.historycolorgridHover); $(document).on('mouseleave', '.historycolorgrid td', this.historycolorgidUnhover); $(document).on('mouseenter', 'li.dropdown', this.dropdownHover); - $(document).on('mouseleave', 'li.dropdown', this.dropdownLeave); + $(document).on('mouseleave', 'li.dropdown', {self: this}, this.dropdownLeave); - $(document).on('mouseenter', '#menu > ul > li', this.menuTitleHovered); - $(document).on('mouseleave', '#sidebar', this.leaveSidebar); + $(document).on('mouseenter', '#menu > ul > li', { self: this }, this.menuTitleHovered); + $(document).on('mouseleave', '#sidebar', { self: this }, this.leaveSidebar); $(document).on('click', '.tree .handle', { self: this }, this.treeNodeToggle); // Toggle all triStateButtons @@ -135,9 +135,10 @@ // $(document).on('change', 'form.auto select', this.submitForm); }, - menuTitleHovered: function () { + menuTitleHovered: function (event) { var $li = $(this), - delay = 800; + delay = 800, + self = event.data.self; if ($li.hasClass('active')) { $li.siblings().removeClass('hover'); @@ -177,9 +178,10 @@ }, delay); }, - leaveSidebar: function () { - var $sidebar = $(this); - var $li = $sidebar.find('li.hover'); + leaveSidebar: function (event) { + var $sidebar = $(this), + $li = $sidebar.find('li.hover'), + self = event.data.self; if (! $li.length) { $('#layout').removeClass('hoveredmenu'); return; @@ -198,8 +200,9 @@ $(this).addClass('hover'); }, - dropdownLeave: function () { - var $li = $(this); + dropdownLeave: function (event) { + var $li = $(this), + self = event.data.self; setTimeout(function () { // TODO: make this behave well together with keyboard navigation if (! $li.is('li:hover') /*&& ! $li.find('a:focus')*/) {