Skip to content

Commit ed0f632

Browse files
author
nelu
committed
bind Enter on dialogs start button
1 parent d91f1c8 commit ed0f632

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

js/ui-dialogs.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,11 @@ export function FileManagerDialogs(browser) {
7171
self.startedPromise = null;
7272
self.dirBrowser = {}; // multiple file operations are ui blocking
7373

74+
self.bindKeys = (diagId) => {
75+
$("#"+diagId).keydown(function (e) {
76+
(e.keyCode === 13) && self.startButton(diagId).click();
77+
});
78+
};
7479

7580
self.setDialogConfig = (diagId, config) => {
7681
self.forms[diagId] = config;
@@ -95,7 +100,7 @@ export function FileManagerDialogs(browser) {
95100

96101
self.afterShow = (diagId) => {
97102
setTimeout(function () {
98-
self.startButton(diagId).select().focus();
103+
$("#"+diagId).select().focus();
99104
});
100105
}
101106
// common dialog cleanup
@@ -248,6 +253,8 @@ export function FileManagerDialogs(browser) {
248253
self.getDialogHeader(diagId)
249254
.prepend('<icon class="flm-sprite-diag flm-sprite sprite-' + what + '"></icon>');
250255

256+
self.bindKeys(diagId);
257+
251258
// $("#"+diagId).find('.flm-diag-cancel')
252259
// .click(function () {
253260
// console.log("cancel triggered");

0 commit comments

Comments
 (0)