1
0
mirror of synced 2024-11-26 14:56:07 +03:00

fix for dropdown closing as soon as its opened in IE8. fixes #369. fixes #354

This commit is contained in:
Igor Vaynberg 2012-09-10 17:05:11 -07:00
parent b4371aa253
commit 96657a16aa

View File

@ -972,13 +972,18 @@
}); });
}); });
$(window).bind(resize, function() { window.setTimeout(function() {
var s2 = $(selector); // this is done inside a timeout because IE will sometimes fire a resize event while opening
if (s2.length == 0) { // the dropdown and that causes this handler to immediately close it. this way the dropdown
$(window).unbind(resize); // has a chance to fully open before we start listening to resize events
} $(window).bind(resize, function() {
s2.select2("close"); var s2 = $(selector);
}); if (s2.length == 0) {
$(window).unbind(resize);
}
s2.select2("close");
})
}, 10);
this.clearDropdownAlignmentPreference(); this.clearDropdownAlignmentPreference();