Dialog: Fixed modal dialogs so they are always on top of other dialogs when they open.

This commit is contained in:
Scott González
2008-06-04 17:31:58 +00:00
parent 0b2be30492
commit b6858b447c

View File

@@ -230,7 +230,7 @@ $.widget("ui.dialog", {
this.uiDialog.appendTo('body');
this.position(this.options.position);
this.uiDialog.show();
this.moveToTop();
this.moveToTop(true);
// CALLBACK: open
var openEV = null;
@@ -241,8 +241,10 @@ $.widget("ui.dialog", {
this.element.triggerHandler("dialogopen", [openEV, openUI], this.options.open);
},
moveToTop: function() {
if (this.options.modal || !this.options.stack) { return; }
// the force parameter allows us to move modal dialogs to their correct
// position on open
moveToTop: function(force) {
if ((this.options.modal && !force) || !this.options.stack) { return; }
var maxZ = this.options.zIndex, options = this.options;
$('.ui-dialog:visible').each(function() {