diff options
author | Florian Schunk <florian.schunk@rwth-aachen.de> | 2018-12-22 12:23:59 +0100 |
---|---|---|
committer | Florian Schunk <florian.schunk@rwth-aachen.de> | 2019-01-09 11:28:51 +0100 |
commit | b555fb3ff56d77b139f875ff7ea587844afa77b0 (patch) | |
tree | 3a877cf844e6799b0ff0c8027a944e1518dbf56c /core/js | |
parent | ff1e0e2302b2cfe0db888dabae7ad2a876425d1f (diff) | |
download | nextcloud-server-b555fb3ff56d77b139f875ff7ea587844afa77b0.tar.gz nextcloud-server-b555fb3ff56d77b139f875ff7ea587844afa77b0.zip |
open name prompt on pressing enter
Signed-off-by: Florian Schunk <florian.schunk@rwth-aachen.de>
Diffstat (limited to 'core/js')
-rw-r--r-- | core/js/oc-dialogs.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/core/js/oc-dialogs.js b/core/js/oc-dialogs.js index bf87c8b6423..dcdb339c37d 100644 --- a/core/js/oc-dialogs.js +++ b/core/js/oc-dialogs.js @@ -259,6 +259,17 @@ var OCdialogs = { } var newButton = self.$filePicker.find('.actions.creatable .button-add'); + newButton.on('focus', function() { + self.$filePicker.ocdialog('setEnterCallback', function() { + event.stopImmediatePropagation(); + event.preventDefault(); + newButton.click(); + }); + }); + newButton.on('blur', function() { + self.$filePicker.ocdialog('unsetEnterCallback'); + }); + OC.registerMenu(newButton,self.$filePicker.find('.menu'),function () { $input.focus(); self.$filePicker.ocdialog('setEnterCallback', function() { |