aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorJörn Zaefferer <joern.zaefferer@gmail.com>2012-11-15 22:54:49 +0100
committerJörn Zaefferer <joern.zaefferer@gmail.com>2012-11-26 10:28:22 +0100
commit7e964be80c415373be4d204bf444dc12648974c5 (patch)
tree4b2f4e25517353468d967e65ec81ed1cf8d16f30 /ui
parentfed2972027f362181a614750fbaa7e252d1c1cb2 (diff)
downloadjquery-ui-7e964be80c415373be4d204bf444dc12648974c5.tar.gz
jquery-ui-7e964be80c415373be4d204bf444dc12648974c5.zip
Dialog: Have _createButtons access the buttons option directly. Start refactoring _setOption, no need for switch.
Diffstat (limited to 'ui')
-rw-r--r--ui/jquery.ui.dialog.js14
1 files changed, 8 insertions, 6 deletions
diff --git a/ui/jquery.ui.dialog.js b/ui/jquery.ui.dialog.js
index cb4230eac..589898476 100644
--- a/ui/jquery.ui.dialog.js
+++ b/ui/jquery.ui.dialog.js
@@ -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({