From d2f5529653996204c25047d1a400ccf2fe4c560e Mon Sep 17 00:00:00 2001 From: yflory Date: Mon, 21 Sep 2020 15:59:00 +0200 Subject: [PATCH] Better Ctrl+F in the drive --- www/common/drive-ui.js | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/www/common/drive-ui.js b/www/common/drive-ui.js index e01c931ff..63e8d96a7 100644 --- a/www/common/drive-ui.js +++ b/www/common/drive-ui.js @@ -50,6 +50,17 @@ define([ allowFolderUpload: File.prototype.hasOwnProperty("webkitRelativePath"), }; + $(window).keydown(function (e) { + if (e.which === 70 && e.ctrlKey) { + e.preventDefault(); + e.stopPropagation(); + if (APP.displayDirectory) { + APP.displayDirectory([SEARCH]); + } + return; + } + }); + var stringify = function (obj) { return JSONSortify(obj); }; @@ -4592,12 +4603,6 @@ define([ moveElements(paths, [TRASH], false, refresh); return; } - if (e.which === 70 && e.ctrlKey) { - e.preventDefault(); - e.stopPropagation(); - APP.displayDirectory([SEARCH]); - return; - } }); $appContainer.contextmenu(function () { APP.hideMenu();