From 1da51d081ffc4d54a6e31273826f6114ea9adf1d Mon Sep 17 00:00:00 2001 From: Alex Vitkov Date: Sat, 13 Feb 2021 16:25:21 +0200 Subject: icons --- loggedin.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'loggedin.js') diff --git a/loggedin.js b/loggedin.js index 9a37c91..a98ef8b 100644 --- a/loggedin.js +++ b/loggedin.js @@ -406,7 +406,9 @@ function make_window(pwd) { function add_file_visuals(fileview) { - var is_in_trash = focus.pwd.length == 1 && focus.pwd[0] == "trash"; + // Are we in a subdirectory of the trash folder + var is_in_trash = focus.pwd.length > 0 && focus.pwd[0] == "trash"; + // Is the current filewview the trash folder itself var is_trash = focus.pwd.length == 0 && fileview.filename == "trash"; var visuals = document.createElement('div'); @@ -458,7 +460,7 @@ function add_file_visuals(fileview) { } visuals.ondragstart = (e) => { - if (focus.pwd.length == 0 && fileview.filename == "trash") { + if (is_trash || is_in_trash) { e.preventDefault(); return; } -- cgit v1.2.3