open name prompt on pressing enter

Signed-off-by: Florian Schunk <florian.schunk@rwth-aachen.de>
This commit is contained in:
Florian Schunk 2018-12-22 12:23:59 +01:00
parent ff1e0e2302
commit b555fb3ff5
1 changed files with 11 additions and 0 deletions

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