diff options
author | Robin Appelman <icewind@owncloud.com> | 2013-09-12 21:43:35 +0200 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2013-09-12 21:43:35 +0200 |
commit | c9d26631592ba58d8026a14e7f637cfe835fa15d (patch) | |
tree | b6bc91006e0207a2e2b26ba5d1205853e0ca7fda /core/js/jquery.ocdialog.js | |
parent | b9167196fb331d7197210e4a130e03d32d839b8a (diff) | |
parent | c7ca86799b2608609ead7ecd2d84d0bbd47c6548 (diff) | |
download | nextcloud-server-c9d26631592ba58d8026a14e7f637cfe835fa15d.tar.gz nextcloud-server-c9d26631592ba58d8026a14e7f637cfe835fa15d.zip |
Merge branch 'master' into fileapi-foreward
Diffstat (limited to 'core/js/jquery.ocdialog.js')
-rw-r--r-- | core/js/jquery.ocdialog.js | 16 |
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': |