From 653886debe280857a1ff8102f66d6fd90ac3b54e Mon Sep 17 00:00:00 2001 From: joshuaboud Date: Mon, 21 Jun 2021 12:02:18 -0300 Subject: [PATCH] disable entry if inaccessible --- navigator/navigator.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/navigator/navigator.js b/navigator/navigator.js index 5486f11..65b8bfb 100644 --- a/navigator/navigator.js +++ b/navigator/navigator.js @@ -232,8 +232,12 @@ class NavEntry { this.dom_element.appendChild(icon); this.dom_element.appendChild(title); this.stat = stat; - this.dom_element.addEventListener("click", this); - this.dom_element.addEventListener("contextmenu", this); + if (stat && stat["inaccessible"]) { + this.dom_element.style.cursor = "not-allowed"; + } else { + this.dom_element.addEventListener("click", this); + this.dom_element.addEventListener("contextmenu", this); + } this.is_hidden_file = this.filename().startsWith('.'); if (this.is_hidden_file) icon.style.opacity = 0.5; @@ -1557,7 +1561,7 @@ class NavWindow { [start, end] = [end, start]; if (end === -1) return; - to_be_selected = this.entries.slice(start, end + 1); + to_be_selected = this.entries.slice(start, end + 1).filter(entry => !entry.stat["inaccessible"]); } else { if (!append) this.selected_entries.clear();