mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
Dialog: Have _createButtons access the buttons option directly. Start refactoring _setOption, no need for switch.
This commit is contained in:
parent
fed2972027
commit
7e964be80c
14
ui/jquery.ui.dialog.js
vendored
14
ui/jquery.ui.dialog.js
vendored
@ -191,7 +191,7 @@ $.widget("ui.dialog", {
|
||||
}
|
||||
|
||||
// TODO merge with _createButtonPane?
|
||||
this._createButtons( options.buttons );
|
||||
this._createButtons();
|
||||
|
||||
this._isOpen = false;
|
||||
|
||||
@ -362,8 +362,9 @@ $.widget("ui.dialog", {
|
||||
this._delay( checkFocus );
|
||||
},
|
||||
|
||||
_createButtons: function( buttons ) {
|
||||
var that = this;
|
||||
_createButtons: function() {
|
||||
var that = this,
|
||||
buttons = this.options.buttons;
|
||||
|
||||
// if we already have a button pane, remove it
|
||||
this.uiDialogButtonPane.remove();
|
||||
@ -573,10 +574,11 @@ $.widget("ui.dialog", {
|
||||
|
||||
this._super( key, value );
|
||||
|
||||
if ( key === "buttons" ) {
|
||||
this._createButtons();
|
||||
}
|
||||
|
||||
switch ( key ) {
|
||||
case "buttons":
|
||||
this._createButtons( value );
|
||||
break;
|
||||
case "closeText":
|
||||
// ensure that we always pass a string
|
||||
this.uiDialogTitlebarClose.button({
|
||||
|
Loading…
Reference in New Issue
Block a user