summaryrefslogtreecommitdiffstats
path: root/core/js/jquery.ocdialog.js
diff options
context:
space:
mode:
authorThomas Tanghus <thomas@tanghus.net>2013-09-10 00:21:42 +0200
committerThomas Tanghus <thomas@tanghus.net>2013-09-10 00:21:42 +0200
commit51547c33161b28dfa46ff0c160fada646737bdf1 (patch)
tree6882c73f8e578a27955d1bee48243eafa65539c7 /core/js/jquery.ocdialog.js
parent63a5409c6eed63941256a453aef506ee6652d74c (diff)
downloadnextcloud-server-51547c33161b28dfa46ff0c160fada646737bdf1.tar.gz
nextcloud-server-51547c33161b28dfa46ff0c160fada646737bdf1.zip
Fix setting ocdialog options after initialization.
Diffstat (limited to 'core/js/jquery.ocdialog.js')
-rw-r--r--core/js/jquery.ocdialog.js14
1 files changed, 9 insertions, 5 deletions
diff --git a/core/js/jquery.ocdialog.js b/core/js/jquery.ocdialog.js
index bafbd0e0e9f..ee492d15f58 100644
--- a/core/js/jquery.ocdialog.js
+++ b/core/js/jquery.ocdialog.js
@@ -83,20 +83,22 @@
var self = this;
switch(key) {
case 'title':
- var $title = $('<h3 class="oc-dialog-title">' + this.options.title
- + '</h3>'); //<hr class="oc-dialog-separator" />');
if(this.$title) {
- this.$title.replaceWith($title);
+ this.$title.text(value);
} else {
+ var $title = $('<h3 class="oc-dialog-title">'
+ + value
+ + '</h3>');
this.$title = $title.prependTo(this.$dialog);
}
this._setSizes();
break;
case 'buttons':
- var $buttonrow = $('<div class="oc-dialog-buttonrow" />');
+ console.log('buttons', value);
if(this.$buttonrow) {
- this.$buttonrow.replaceWith($buttonrow);
+ this.$buttonrow.empty();
} else {
+ var $buttonrow = $('<div class="oc-dialog-buttonrow" />');
this.$buttonrow = $buttonrow.appendTo(this.$dialog);
}
$.each(value, function(idx, val) {
@@ -124,6 +126,8 @@
$closeButton.on('click', function() {
self.close();
});
+ } else {
+ this.$dialog.find('.oc-dialog-close').remove();
}
break;
case 'width':