summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Tanghus <thomas@tanghus.net>2013-09-11 12:20:17 -0700
committerThomas Tanghus <thomas@tanghus.net>2013-09-11 12:20:17 -0700
commit80bf1969f97fca3d2cb5f9edd6ad09115728497a (patch)
tree7663728aca8556eab7101bf79c25b0e7e1b54554
parent62eeac33900bdb13b823049d8cc63f44e0bca24f (diff)
parent7a2b23a0363032e5bcbc38546ab62aca122635bb (diff)
downloadnextcloud-server-80bf1969f97fca3d2cb5f9edd6ad09115728497a.tar.gz
nextcloud-server-80bf1969f97fca3d2cb5f9edd6ad09115728497a.zip
Merge pull request #4784 from owncloud/ocdialog_option_setter
Fix setting ocdialog options after initialization.
-rw-r--r--core/js/jquery.ocdialog.js16
1 files changed, 10 insertions, 6 deletions
diff --git a/core/js/jquery.ocdialog.js b/core/js/jquery.ocdialog.js
index bafbd0e0e9f..f1836fd4727 100644
--- a/core/js/jquery.ocdialog.js
+++ b/core/js/jquery.ocdialog.js
@@ -39,7 +39,8 @@
return;
}
// Escape
- if(event.keyCode === 27 && self.options.closeOnEscape) {
+ if(event.keyCode === 27 && event.type === 'keydown' && self.options.closeOnEscape) {
+ event.stopImmediatePropagation();
self.close();
return false;
}
@@ -83,20 +84,21 @@
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" />');
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':