Skip to content
This repository was archived by the owner on Jul 24, 2019. It is now read-only.

Commit d90b1ff

Browse files
committed
Merge branch 'michelbalzer-patch-1' into development
2 parents f8a868c + 193ff25 commit d90b1ff

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

flexmenu.js

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
factory(jQuery);
1313
}
1414
}(function ($) {
15+
var windowWidth = $(window).width(); // Store the window width
16+
var windowHeight = $(window).height(); // Store the window height
1517
var flexObjects = [], // Array of all flexMenu objects
1618
resizeTimeout;
1719
// When the page is resized, adjust the flexMenus.
@@ -30,10 +32,14 @@
3032
$menusToCollapse.removeClass('active').find('> ul').hide();
3133
}
3234
$(window).resize(function () {
33-
clearTimeout(resizeTimeout);
34-
resizeTimeout = setTimeout(function () {
35-
adjustFlexMenu();
36-
}, 200);
35+
if ($(window).width() != windowWidth && $(window).height() != windowHeight) {
36+
clearTimeout(resizeTimeout);
37+
resizeTimeout = setTimeout(function () {
38+
adjustFlexMenu();
39+
}, 200);
40+
windowWidth = $(window).width(); // Store the window width if it changed
41+
windowHeight = $(window).height(); // Store the window height if it changed
42+
}
3743
});
3844
$.fn.flexMenu = function (options) {
3945
var checkFlexObject,

0 commit comments

Comments
 (0)