From a66f9b08e57ec10a484d6ca658ce52a7096870be Mon Sep 17 00:00:00 2001 From: Alex Vitkov Date: Sat, 13 Feb 2021 16:13:03 +0200 Subject: can no longer rename the fucking trashcan --- loggedin.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'loggedin.js') diff --git a/loggedin.js b/loggedin.js index 8de7c2b..9a37c91 100644 --- a/loggedin.js +++ b/loggedin.js @@ -407,6 +407,7 @@ function make_window(pwd) { function add_file_visuals(fileview) { var is_in_trash = focus.pwd.length == 1 && focus.pwd[0] == "trash"; + var is_trash = focus.pwd.length == 0 && fileview.filename == "trash"; var visuals = document.createElement('div'); fileview.visuals = visuals; @@ -442,7 +443,7 @@ function add_file_visuals(fileview) { if (is_in_trash) { context_list.push(['Restore', () => { restore_from_trash(fileview.filename); }]); context_list.push(['Delete forever', () => { delete_file(fileview.filename); }]); - } else { + } else if (!is_trash) { context_list.push( ['Rename', () => { rename_file(fileview.filename); }], ['Share', () => {alert('not implemented')}], @@ -479,6 +480,8 @@ function add_file_visuals(fileview) { if (is_in_trash) { var split = fileview.filename.split("/"); filename.innerText = split[split.length - 1]; + } else if (is_trash) { + filename.innerText = "Trash"; } else { filename.innerText = fileview.filename; } -- cgit v1.2.3