checkFlexObject is not verified properly.
Closed this issue · 2 comments
jazwidz commented
Currently, the following function is run every time the window resizes:
function adjustFlexMenu() {
if ($(window).width() !== windowWidth || $(window).height() !== windowHeight) {
$(flexObjects).each(function () {
$(this).flexMenu({
'undo' : true
}).flexMenu(this.options);
});
windowWidth = $(window).width(); // Store the window width if it changed
windowHeight = $(window).height(); // Store the window height if it changed
}
}
Since the method used for checkFlexObject involves comparing the flexObject with the options attached, if the original flexObject did not have only the option
{
'undo' : true
}
It will return -1 and add another instance to the flexObjects array.
rdebeasi commented
Oof, so it does. That probably is harmful to performance on pages that are resized multiple times. Thanks for the heads-up!
More broadly, I'd actually like to get rid of the undo
option and replace it with proper destroy()
and refresh()
methods - see #7.
rdebeasi commented
Archiving this repo and closing all open issues. Thank you so much for your feedback - see you around the internet!! 🙂