|
|
@@ -309,6 +309,7 @@
|
|
|
},
|
|
|
setButtons: function(buttons) {
|
|
|
this.options.buttons = buttons;
|
|
|
+ this.updateButtons();
|
|
|
|
|
|
return this;
|
|
|
},
|
|
|
@@ -334,6 +335,17 @@
|
|
|
|
|
|
return '';
|
|
|
},
|
|
|
+ updateButtons: function() {
|
|
|
+ if (this.isRealized()) {
|
|
|
+ if (this.getButtons().length === 0) {
|
|
|
+ this.getModalFooter().hide();
|
|
|
+ } else {
|
|
|
+ this.getModalFooter().find('.' + this.getNamespace('footer')).html('').append(this.createFooterButtons());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return this;
|
|
|
+ },
|
|
|
isAutodestroy: function() {
|
|
|
return this.options.autodestroy;
|
|
|
},
|
|
|
@@ -394,9 +406,6 @@
|
|
|
var $container = $('<div></div>');
|
|
|
$container.addClass(this.getNamespace('footer'));
|
|
|
|
|
|
- // Buttons
|
|
|
- $container.append(this.createFooterButtons());
|
|
|
-
|
|
|
return $container;
|
|
|
},
|
|
|
createFooterButtons: function() {
|
|
|
@@ -679,6 +688,7 @@
|
|
|
this.makeModalDraggable();
|
|
|
this.handleModalEvents();
|
|
|
this.setRealized(true);
|
|
|
+ this.updateButtons();
|
|
|
this.updateTitle();
|
|
|
this.updateMessage();
|
|
|
this.updateClosable();
|