mirror of
https://github.com/nextcloud/server.git
synced 2026-06-08 16:26:59 -04:00
Use keyboard controls for new folder creation
Signed-off-by: Christopher Ng <chrng8@gmail.com>
This commit is contained in:
parent
0b0ef105c5
commit
16d2238de5
5 changed files with 15 additions and 15 deletions
|
|
@ -323,7 +323,7 @@ const Dialogs = {
|
|||
newButton.hide()
|
||||
}
|
||||
newButton.on('focus', function() {
|
||||
self.$filePicker.ocdialog('setEnterCallback', function() {
|
||||
self.$filePicker.ocdialog('setEnterCallback', function(event) {
|
||||
event.stopImmediatePropagation()
|
||||
event.preventDefault()
|
||||
newButton.click()
|
||||
|
|
@ -336,7 +336,7 @@ const Dialogs = {
|
|||
OC.registerMenu(newButton, self.$filePicker.find('.menu'), function() {
|
||||
$input.tooltip('hide')
|
||||
$input.focus()
|
||||
self.$filePicker.ocdialog('setEnterCallback', function() {
|
||||
self.$filePicker.ocdialog('setEnterCallback', function(event) {
|
||||
event.stopImmediatePropagation()
|
||||
event.preventDefault()
|
||||
self.$filePicker.submit()
|
||||
|
|
@ -351,6 +351,13 @@ const Dialogs = {
|
|||
var $form = self.$filePicker.find('.filenameform')
|
||||
var $input = $form.find('input[type=\'text\']')
|
||||
var $submit = $form.find('input[type=\'submit\']')
|
||||
$input.on('keydown', function(event) {
|
||||
if (event.key === 'Enter') {
|
||||
event.stopImmediatePropagation()
|
||||
event.preventDefault()
|
||||
$form.submit()
|
||||
}
|
||||
})
|
||||
$submit.on('click', function(event) {
|
||||
event.stopImmediatePropagation()
|
||||
event.preventDefault()
|
||||
|
|
@ -427,13 +434,6 @@ const Dialogs = {
|
|||
$input.val(newText)
|
||||
}
|
||||
})
|
||||
$input.keypress(function(event) {
|
||||
if (event.keyCode === 13 || event.which === 13) {
|
||||
event.stopImmediatePropagation()
|
||||
event.preventDefault()
|
||||
$form.submit()
|
||||
}
|
||||
})
|
||||
$input.on('input', function(event) {
|
||||
$input.tooltip('hide')
|
||||
})
|
||||
|
|
|
|||
4
dist/core-login.js
vendored
4
dist/core-login.js
vendored
File diff suppressed because one or more lines are too long
2
dist/core-login.js.map
vendored
2
dist/core-login.js.map
vendored
File diff suppressed because one or more lines are too long
4
dist/core-main.js
vendored
4
dist/core-main.js
vendored
File diff suppressed because one or more lines are too long
2
dist/core-main.js.map
vendored
2
dist/core-main.js.map
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue