Browse Source

open name prompt on pressing enter

Signed-off-by: Florian Schunk <florian.schunk@rwth-aachen.de>
tags/v16.0.0alpha1
Florian Schunk 5 years ago
parent
commit
b555fb3ff5
1 changed files with 11 additions and 0 deletions
  1. 11
    0
      core/js/oc-dialogs.js

+ 11
- 0
core/js/oc-dialogs.js View File

@@ -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() {

Loading…
Cancel
Save