From dba14fac8b394377107cfef3ce8f53c538aebcec Mon Sep 17 00:00:00 2001 From: Florian Schunk Date: Thu, 20 Dec 2018 14:34:26 +0100 Subject: add functionality to create new folder in file picker Signed-off-by: Florian Schunk --- core/js/jquery.ocdialog.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'core/js/jquery.ocdialog.js') 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; -- cgit v1.2.3