Permalink
Browse files

Really moved updateMaxZ into dialog prototype this time.

  • Loading branch information...
1 parent b15c419 commit e2bebd4027331432ffedb9b98cdd78a074f405e6 @Akkuma committed Oct 31, 2011
Showing with 17 additions and 17 deletions.
  1. +17 −17 ui/jquery.ui.dialog.js
View
@@ -36,21 +36,6 @@ var uiDialogClasses = "ui-dialog ui-widget ui-widget-content ui-corner-all ",
},
dialogs = {};
- function updateMaxZ($currentDialog) {
- var self = this,
- maxZ = self.options.zIndex;
-
- $.each(dialogs, function() {
- if (this.uiDialog[0] !== self.uiDialog[0] && this._isOpen) {
- thisZ = this.uiDialog.css('z-index');
- if(!isNaN(thisZ)) {
- maxZ = Math.max(maxZ, thisZ);
- }
- }
- });
- $.ui.dialog.maxZ = maxZ;
- }
-
$.widget("ui.dialog", {
version: "@VERSION",
options: {
@@ -243,11 +228,26 @@ $.widget("ui.dialog", {
// adjust the maxZ to allow other modal dialogs to continue to work (see #4309)
if (self.options.modal) {
- updateMaxZ.call(self);
+ self._updateMaxZ();
}
return self;
},
+
+ _updateMaxZ: function() {
+ var self = this,
+ maxZ = self.options.zIndex;
+
+ $.each(dialogs, function() {
+ if (this.uiDialog[0] !== self.uiDialog[0] && this._isOpen) {
+ thisZ = this.uiDialog.css('z-index');
+ if(!isNaN(thisZ)) {
+ maxZ = Math.max(maxZ, thisZ);
+ }
+ }
+ });
+ $.ui.dialog.maxZ = maxZ;
+ },
isOpen: function() {
return this._isOpen;
@@ -267,7 +267,7 @@ $.widget("ui.dialog", {
//moveToTop method does not have a true/false passed down from dialog('moveToTop')
if (force || force === undefined) {
- updateMaxZ.call(self);
+ self._updateMaxZ();
if (self.overlay) {
$.ui.dialog.maxZ += 1;

0 comments on commit e2bebd4

Please sign in to comment.