From b6858b447cc1a2eec2a8d3d85278ecd9b15eb864 Mon Sep 17 00:00:00 2001 From: Scott González Date: Wed, 4 Jun 2008 17:31:58 +0000 Subject: Dialog: Fixed modal dialogs so they are always on top of other dialogs when they open. --- ui/source/ui.dialog.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ui/source/ui.dialog.js b/ui/source/ui.dialog.js index 40356e518..4299910b3 100644 --- a/ui/source/ui.dialog.js +++ b/ui/source/ui.dialog.js @@ -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() { -- cgit v1.2.3