Skip to content
Prev Previous commit
Next Next commit
open name prompt on pressing enter
Signed-off-by: Florian Schunk <[email protected]>
  • Loading branch information
rummatee committed Jan 9, 2019
commit b555fb3ff56d77b139f875ff7ea587844afa77b0
11 changes: 11 additions & 0 deletions core/js/oc-dialogs.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down