fix hiding divs and make hidden files transparent

This commit is contained in:
joshuaboud 2021-06-03 15:24:23 -03:00
parent 4bbd81105b
commit 828748c964
No known key found for this signature in database
GPG Key ID: 17EFB59E2A8BF50E

View File

@ -164,6 +164,8 @@ class NavEntry {
this.dom_element.addEventListener("click", this); this.dom_element.addEventListener("click", this);
this.dom_element.addEventListener("contextmenu", this); this.dom_element.addEventListener("contextmenu", this);
this.is_hidden_file = this.filename().startsWith('.'); this.is_hidden_file = this.filename().startsWith('.');
if (this.is_hidden_file)
icon.style.opacity = 0.5;
this.dom_element.title = this.filename(); this.dom_element.title = this.filename();
} }
@ -760,14 +762,14 @@ class NavContextMenu {
this.nav_window_ref.clip_board = [...this.nav_window_ref.selected_entries]; this.nav_window_ref.clip_board = [...this.nav_window_ref.selected_entries];
this.nav_window_ref.copy_or_move = "move"; this.nav_window_ref.copy_or_move = "move";
this.nav_window_ref.paste_cwd = this.nav_window_ref.pwd().path_str(); this.nav_window_ref.paste_cwd = this.nav_window_ref.pwd().path_str();
this.menu_options["paste"].hidden = false; this.menu_options["paste"].style.display = "block";
} }
copy() { copy() {
this.nav_window_ref.clip_board = [...this.nav_window_ref.selected_entries]; this.nav_window_ref.clip_board = [...this.nav_window_ref.selected_entries];
this.nav_window_ref.copy_or_move = "copy"; this.nav_window_ref.copy_or_move = "copy";
this.nav_window_ref.paste_cwd = this.nav_window_ref.pwd().path_str(); this.nav_window_ref.paste_cwd = this.nav_window_ref.pwd().path_str();
this.menu_options["paste"].hidden = false; this.menu_options["paste"].style.display = "block";
} }
paste() { paste() {
@ -809,18 +811,18 @@ class NavContextMenu {
this.nav_window_ref.set_selected(target, false, false); this.nav_window_ref.set_selected(target, false, false);
} }
if (target === this.nav_window_ref.pwd()) { if (target === this.nav_window_ref.pwd()) {
this.menu_options["copy"].hidden = true; this.menu_options["copy"].style.display = "none";
this.menu_options["cut"].hidden = true; this.menu_options["cut"].style.display = "none";
this.menu_options["delete"].hidden = true; this.menu_options["delete"].style.display = "none";
} else { } else {
this.menu_options["copy"].hidden = false; this.menu_options["copy"].style.display = "block";
this.menu_options["cut"].hidden = false; this.menu_options["cut"].style.display = "block";
this.menu_options["delete"].hidden = false; this.menu_options["delete"].style.display = "block";
} }
if (this.nav_window_ref.selected_entries.size > 1) { if (this.nav_window_ref.selected_entries.size > 1) {
this.menu_options["rename"].hidden = true; this.menu_options["rename"].style.display = "none";
} else { } else {
this.menu_options["rename"].hidden = false; this.menu_options["rename"].style.display = "block";
} }
this.target = target; this.target = target;
this.dom_element.style.display = "inline"; this.dom_element.style.display = "inline";
@ -833,7 +835,7 @@ class NavContextMenu {
} }
hide_paste() { hide_paste() {
this.menu_options["paste"].hidden = true; this.menu_options["paste"].style.display = "none";
} }
} }
@ -1437,9 +1439,10 @@ class NavWindow {
proc.fail((e, data) => { proc.fail((e, data) => {
window.alert("Paste failed."); window.alert("Paste failed.");
}); });
await proc; proc.always(() => {
this.stop_load(); this.stop_load();
this.refresh(); this.refresh();
});
} }
/** /**
@ -1489,7 +1492,7 @@ class NavWindow {
} }
start_load() { start_load() {
document.getElementById("nav-loader-container").hidden = false; document.getElementById("nav-loader-container").style.display = "block";
var buttons = document.getElementsByTagName("button"); var buttons = document.getElementsByTagName("button");
for (let button of buttons) { for (let button of buttons) {
button.disabled = true; button.disabled = true;
@ -1497,7 +1500,7 @@ class NavWindow {
} }
stop_load() { stop_load() {
document.getElementById("nav-loader-container").hidden = true; document.getElementById("nav-loader-container").style.display = "none";
var buttons = document.getElementsByTagName("button"); var buttons = document.getElementsByTagName("button");
for (let button of buttons) { for (let button of buttons) {
button.disabled = false; button.disabled = false;