mirror of
https://github.com/45Drives/cockpit-navigator.git
synced 2025-07-30 00:55:30 +02:00
disable entry if inaccessible
This commit is contained in:
parent
b958496a5b
commit
653886debe
@ -232,8 +232,12 @@ class NavEntry {
|
|||||||
this.dom_element.appendChild(icon);
|
this.dom_element.appendChild(icon);
|
||||||
this.dom_element.appendChild(title);
|
this.dom_element.appendChild(title);
|
||||||
this.stat = stat;
|
this.stat = stat;
|
||||||
this.dom_element.addEventListener("click", this);
|
if (stat && stat["inaccessible"]) {
|
||||||
this.dom_element.addEventListener("contextmenu", this);
|
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('.');
|
this.is_hidden_file = this.filename().startsWith('.');
|
||||||
if (this.is_hidden_file)
|
if (this.is_hidden_file)
|
||||||
icon.style.opacity = 0.5;
|
icon.style.opacity = 0.5;
|
||||||
@ -1557,7 +1561,7 @@ class NavWindow {
|
|||||||
[start, end] = [end, start];
|
[start, end] = [end, start];
|
||||||
if (end === -1)
|
if (end === -1)
|
||||||
return;
|
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 {
|
} else {
|
||||||
if (!append)
|
if (!append)
|
||||||
this.selected_entries.clear();
|
this.selected_entries.clear();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user