Showing with 7 additions and 35 deletions.
  1. +7 −35 ui/jquery.ui.dialog.js
@@ -205,17 +205,13 @@ $.widget("ui.dialog", {
return;
}

// TODO remove useless tmp vars
var options = this.options,
uiDialog = this.uiDialog;

this.opener = $( this.document[ 0 ].activeElement );

this._size();
this._position( options.position );
this.overlay = options.modal ? new $.ui.dialog.overlay( this ) : null;
this._position( this.options.position );
this.overlay = this.options.modal ? new $.ui.dialog.overlay( this ) : null;
this._moveToTop( null, true );
this._show( uiDialog, options.show );
this._show( this.uiDialog, this.options.show );

this._focusTabbable();

@@ -373,7 +369,7 @@ $.widget("ui.dialog", {

if ( !$.isEmptyObject( buttons ) ) {
$.each( buttons, function( name, props ) {
var button, click;
var click;
props = $.isFunction( props ) ?
{ click: props, text: name } :
props;
@@ -384,12 +380,10 @@ $.widget("ui.dialog", {
props.click = function() {
click.apply( that.element[0], arguments );
};
button = $( "<button></button>", props )
.appendTo( that.uiButtonSet );
if ( $.fn.button ) {
$( "<button></button>", props )
// TODO allow passing through button options
button.button();
}
.button()
.appendTo( that.uiButtonSet );
});
this.uiDialog.addClass( "ui-dialog-buttons" );
this.uiDialogButtonPane.appendTo( this.uiDialog );
@@ -433,7 +427,6 @@ $.widget("ui.dialog", {
});
},

// TODO why are handles passed by _setOption??
_makeResizable: function() {
var that = this,
options = this.options,
@@ -586,15 +579,6 @@ $.widget("ui.dialog", {
});
}

if ( key === "disabled" ) {
// TODO use toggleClass( "ui-dialog-disabled", value )
if ( value ) {
uiDialog.addClass( "ui-dialog-disabled" );
} else {
uiDialog.removeClass( "ui-dialog-disabled" );
}
}

if ( key === "draggable" ) {
isDraggable = uiDialog.is( ":data(ui-draggable)" );
if ( isDraggable && !value ) {
@@ -630,7 +614,6 @@ $.widget("ui.dialog", {

if ( key === "title" ) {
// convert whatever was passed in to a string, for html() to not throw up
// TODO deduplicate this (see _create)
$( ".ui-dialog-title", this.uiDialogTitlebar )
.html( "" + ( value || "&#160;" ) );
}
@@ -679,17 +662,6 @@ $.widget("ui.dialog", {
});

$.extend($.ui.dialog, {
// TODO remove these
uuid: 0,
getTitleId: function($el) {
var id = $el.attr( "id" );
if ( !id ) {
this.uuid += 1;
id = this.uuid;
}
return "ui-dialog-title-" + id;
},

// TODO move to dialog instance method
overlay: function( dialog ) {
this.$el = $.ui.dialog.overlay.create( dialog );