diff options
author | Florian Schunk <florian.schunk@rwth-aachen.de> | 2018-12-20 14:34:26 +0100 |
---|---|---|
committer | Florian Schunk <florian.schunk@rwth-aachen.de> | 2019-01-09 11:28:51 +0100 |
commit | dba14fac8b394377107cfef3ce8f53c538aebcec (patch) | |
tree | 95c7433c2d69b3fdb3a24b6e54443b0102d3a9e0 /core/js/jquery.ocdialog.js | |
parent | 74197462c0299a766b33289571dcbdc54b6eeabd (diff) | |
download | nextcloud-server-dba14fac8b394377107cfef3ce8f53c538aebcec.tar.gz nextcloud-server-dba14fac8b394377107cfef3ce8f53c538aebcec.zip |
add functionality to create new folder in file picker
Signed-off-by: Florian Schunk <florian.schunk@rwth-aachen.de>
Diffstat (limited to 'core/js/jquery.ocdialog.js')
-rw-r--r-- | core/js/jquery.ocdialog.js | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/core/js/jquery.ocdialog.js b/core/js/jquery.ocdialog.js index 02bd3069c59..daf6cf3ca5c 100644 --- a/core/js/jquery.ocdialog.js +++ b/core/js/jquery.ocdialog.js @@ -34,6 +34,8 @@ position: 'fixed' }); + this.enterCallback = null; + $(document).on('keydown keyup', function(event) { if ( event.target !== self.$dialog.get(0) && @@ -54,6 +56,11 @@ // Enter if(event.keyCode === 13) { event.stopImmediatePropagation(); + if (self.enterCallback != null) { + self.enterCallback(); + event.preventDefault(); + return false; + } if(event.type === 'keyup') { event.preventDefault(); return false; @@ -206,6 +213,12 @@ widget: function() { return this.$dialog; }, + setEnterCallback: function(callback) { + this.enterCallback = callback; + }, + unsetEnterCallback: function() { + this.enterCallback = null; + }, close: function() { this._destroyOverlay(); var self = this; |