Skip to content
Permalink
Browse files

dialog: added "focus" callback, whenever a dialog is focussed (moveTo…

…Top), implements #2728, fixed a couple jslint warnings
  • Loading branch information
Paul Bakaus
Paul Bakaus committed Jul 4, 2008
1 parent 5391782 commit 3c14d55021f42359d10b18197bb82f53e446d1f2
Showing with 5 additions and 3 deletions.
  1. +5 −3 ui/ui.dialog.js
@@ -241,8 +241,8 @@ $.widget("ui.dialog", {
var container = this.uiDialogContainer,
titlebar = this.uiDialogTitlebar,
content = this.element,
tbMargin = parseInt(content.css('margin-top')) + parseInt(content.css('margin-bottom')),
lrMargin = parseInt(content.css('margin-left')) + parseInt(content.css('margin-right'));
tbMargin = parseInt(content.css('margin-top'),10) + parseInt(content.css('margin-bottom'),10),
lrMargin = parseInt(content.css('margin-left'),10) + parseInt(content.css('margin-right'),10);
content.height(container.height() - titlebar.outerHeight() - tbMargin);
content.width(container.width() - lrMargin);
},
@@ -272,14 +272,16 @@ $.widget("ui.dialog", {
// position on open
moveToTop: function(force) {
if ((this.options.modal && !force)
|| (!this.options.stack && !this.options.modal)) { return; }
|| (!this.options.stack && !this.options.modal)) { return this.element.triggerHandler("dialogfocus", [null, { options: this.options }], this.options.focus); }

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.element.triggerHandler("dialogfocus", [null, { options: this.options }], this.options.focus);
},

close: function() {

0 comments on commit 3c14d55

Please sign in to comment.
You can’t perform that action at this time.