aboutsummaryrefslogtreecommitdiffstats
path: root/ui/ui.dialog.js
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2008-09-29 13:08:14 +0000
committerScott González <scott.gonzalez@gmail.com>2008-09-29 13:08:14 +0000
commitc9a8ee531c2c46b686506cacac92d4873013a831 (patch)
treef89796bf268411ead87e24e91675496273bb9969 /ui/ui.dialog.js
parent212a822c480c6c43d203e8d531e2d3be3da3342f (diff)
downloadjquery-ui-c9a8ee531c2c46b686506cacac92d4873013a831.tar.gz
jquery-ui-c9a8ee531c2c46b686506cacac92d4873013a831.zip
Dialog: Made moveToTop public.
Diffstat (limited to 'ui/ui.dialog.js')
-rw-r--r--ui/ui.dialog.js44
1 files changed, 22 insertions, 22 deletions
diff --git a/ui/ui.dialog.js b/ui/ui.dialog.js
index 118460d7c..f6ce4f5ee 100644
--- a/ui/ui.dialog.js
+++ b/ui/ui.dialog.js
@@ -83,7 +83,7 @@ $.widget("ui.dialog", {
.ariaRole("dialog")
.ariaState("labelledby", titleId)
.mousedown(function() {
- self._moveToTop();
+ self.moveToTop();
}),
uiDialogButtonPane = (this.uiDialogButtonPane = $('<div/>'))
@@ -158,6 +158,25 @@ $.widget("ui.dialog", {
return this._isOpen;
},
+ // 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 && !this.options.modal)) {
+ return this._trigger('focus', null, { options: this.options });
+ }
+
+ var maxZ = this.options.zIndex, options = this.options;
+ $('.ui-dialog:visible').each(function() {
+ maxZ = Math.max(maxZ, parseInt($(this).css('z-index'), 10) || options.zIndex);
+ });
+ (this.overlay && this.overlay.$el.css('z-index', ++maxZ));
+ this.uiDialog.css('z-index', ++maxZ);
+
+ this._trigger('focus', null, { options: this.options });
+ },
+
open: function() {
if (this._isOpen) { return; }
@@ -166,7 +185,7 @@ $.widget("ui.dialog", {
this._position(this.options.position);
this.uiDialog.show(this.options.show);
(this.options.autoResize && this._size());
- this._moveToTop(true);
+ this.moveToTop(true);
// prevent tabbing out of modal dialogs
(this.options.modal && this.uiDialog.bind('keypress.ui-dialog', function(e) {
@@ -223,7 +242,7 @@ $.widget("ui.dialog", {
helper: options.dragHelper,
handle: '.ui-dialog-titlebar',
start: function() {
- self._moveToTop();
+ self.moveToTop();
(options.dragStart && options.dragStart.apply(self.element[0], arguments));
},
drag: function() {
@@ -267,25 +286,6 @@ $.widget("ui.dialog", {
});
},
- // 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 && !this.options.modal)) {
- return this._trigger('focus', null, { options: this.options });
- }
-
- var maxZ = this.options.zIndex, options = this.options;
- $('.ui-dialog:visible').each(function() {
- maxZ = Math.max(maxZ, parseInt($(this).css('z-index'), 10) || options.zIndex);
- });
- (this.overlay && this.overlay.$el.css('z-index', ++maxZ));
- this.uiDialog.css('z-index', ++maxZ);
-
- this._trigger('focus', null, { options: this.options });
- },
-
_position: function(pos) {
var wnd = $(window), doc = $(document),
pTop = doc.scrollTop(), pLeft = doc.scrollLeft(),