Bug in ui.dialog.js
Bug in ui.dialog.js
Hello!
After hours of searching I think I have found a bug in the script.
It's about this section:
this.activate = function() {
var maxZ = 0;
$('.ui-dialog:visible').each(function() {
maxZ = Math.max(maxZ, parseInt($(this).css("z-index"),10));
});
overlay.$el && overlay.$el.css('z-index', ++maxZ);
uiDialog.css("z-index", ++maxZ);
};
I replaced the line
maxZ = Math.max(maxZ, parseInt($(this).css("z-index"),10));
with
var z = parseInt(jQuery(this).css("z-index"));
if (!isNaN(z)) {
maxZ = Math.max(maxZ, z, 10);
} else {
maxZ = Math.max(maxZ, 10);
}
Now the IE has no script error anymore and in IE + FF the clicked
panel will come to the top. The original code has caused that maxZ is
"undefined". IE has than made a 2147483647 of it and ++maxZ has caused
an error. Stupid behaviour!