From 44de8a41a1de6e16106c3f7d409726236aa87e77 Mon Sep 17 00:00:00 2001 From: yflory Date: Mon, 10 Feb 2020 18:33:59 +0100 Subject: [PATCH] Improve confirm modal keydown listeners --- www/common/common-interface.js | 3 ++- www/common/drive-ui.js | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/www/common/common-interface.js b/www/common/common-interface.js index aad7eaede..b9869ba67 100644 --- a/www/common/common-interface.js +++ b/www/common/common-interface.js @@ -70,6 +70,7 @@ define([ if (typeof(yes) === 'function') { yes(e); } break; } + $(el || window).off('keydown', handler); }; $(el || window).keydown(handler); @@ -587,7 +588,7 @@ define([ $ok.click(); }, function () { $cancel.click(); - }); + }, frame); document.body.appendChild(frame); setTimeout(function () { diff --git a/www/common/drive-ui.js b/www/common/drive-ui.js index e86fa3351..ce5a76e73 100644 --- a/www/common/drive-ui.js +++ b/www/common/drive-ui.js @@ -3345,7 +3345,9 @@ define([ // in history mode we want to focus the version number input if (!history.isHistoryMode && !APP.mobile()) { var st = $tree.scrollTop() || 0; - $tree.find('#cp-app-drive-tree-search-input').focus(); + if (!$('.alertify').length) { + $tree.find('#cp-app-drive-tree-search-input').focus(); + } $tree.scrollTop(st); } $tree.find('#cp-app-drive-tree-search-input')[0].selectionStart = getSearchCursor();