From c07a17d86c8242d1a528ed2f15af6f8822ac8144 Mon Sep 17 00:00:00 2001 From: joshuaboud Date: Fri, 18 Jun 2021 13:03:19 -0300 Subject: [PATCH 1/4] disable navigation buttons when invalid --- navigator/navigator.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/navigator/navigator.js b/navigator/navigator.js index f1200de..5486f11 100644 --- a/navigator/navigator.js +++ b/navigator/navigator.js @@ -1484,8 +1484,15 @@ class NavWindow { this.show_selected_properties(); document.getElementById("nav-num-dirs").innerText = num_dirs.toString(); document.getElementById("nav-num-files").innerText = num_files.toString(); - document.getElementById("nav-num-bytes"). innerText = format_bytes(bytes_sum); + document.getElementById("nav-num-bytes").innerText = format_bytes(bytes_sum); this.stop_load(); + this.set_nav_button_state(); + } + + set_nav_button_state() { + document.getElementById("nav-back-btn").disabled = (this.path_stack_index === 1); + document.getElementById("nav-forward-btn").disabled = (this.path_stack_index === this.path_stack.length - 1); + document.getElementById("nav-up-dir-btn").disabled = (this.pwd().path_str() === "/"); } /** @@ -2065,6 +2072,7 @@ class NavWindow { button.disabled = false; } document.getElementById("pwd").disabled = false; + this.set_nav_button_state(); } select_all() { From f2c9ee22f6a94e094050013ac73a85a52bde3482 Mon Sep 17 00:00:00 2001 From: joshuaboud Date: Fri, 18 Jun 2021 13:03:45 -0300 Subject: [PATCH 2/4] change background of disabled buttons in dark mode --- navigator/navigator.css | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/navigator/navigator.css b/navigator/navigator.css index f36ba8a..f5e9b73 100644 --- a/navigator/navigator.css +++ b/navigator/navigator.css @@ -63,8 +63,9 @@ body { height: 100%; } -.pf-c-button:disabled[data-theme="dark"] { - background-color: var(--border); +[data-theme="dark"] .pf-c-button:disabled { + background-color: var(--container) !important; + border: 1px solid var(--border) !important; } .nav-loader-container { From c008d9b0d73036561fe1c418feacafc9e419c233 Mon Sep 17 00:00:00 2001 From: joshuaboud Date: Fri, 18 Jun 2021 14:38:49 -0300 Subject: [PATCH 3/4] update changelog --- debian/changelog | 6 ++++++ el/cockpit-navigator.spec | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 370ff19..5f734fe 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +cockpit-navigator (0.4.6-1focal) focal; urgency=low + + * Disable navigation buttons when invalid. + + -- Josh Boudreau Fri, 18 Jun 2021 14:38:00 -0300 + cockpit-navigator (0.4.5-1focal) focal; urgency=medium * Fix downloading a single file when the contextmenu diff --git a/el/cockpit-navigator.spec b/el/cockpit-navigator.spec index d46f995..a9115db 100644 --- a/el/cockpit-navigator.spec +++ b/el/cockpit-navigator.spec @@ -1,5 +1,5 @@ Name: cockpit-navigator -Version: 0.4.5 +Version: 0.4.6 Release: 1%{?dist} Summary: A File System Browser for Cockpit. License: GPL-3.0+ @@ -32,6 +32,8 @@ rm -rf %{buildroot} /usr/share/cockpit/navigator/* %changelog +* Fri Jun 18 2021 Josh Boudreau 0.4.6-1 +- Disable navigation buttons when invalid. * Thu Jun 17 2021 Josh Boudreau 0.4.5-1 - Fix downloading a single file when the contextmenu event target is not the file. From 4bfa8e4e96e0330987947cc46d7145d4e27872fc Mon Sep 17 00:00:00 2001 From: joshuaboud Date: Fri, 18 Jun 2021 14:39:20 -0300 Subject: [PATCH 4/4] update install URLs --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 6d97674..cd2455c 100644 --- a/README.md +++ b/README.md @@ -23,12 +23,12 @@ With no command line use needed, you can: # Installation ## From Github Release ### Ubuntu -1. `$ wget https://github.com/45Drives/cockpit-navigator/releases/download/v0.4/cockpit-navigator_0.4.5-1focal_all.deb` -1. `# apt install ./cockpit-navigator_0.4.5-1focal_all.deb` +1. `$ wget https://github.com/45Drives/cockpit-navigator/releases/download/v0.4/cockpit-navigator_0.4.6-1focal_all.deb` +1. `# apt install ./cockpit-navigator_0.4.6-1focal_all.deb` ### EL7 -1. `# yum install https://github.com/45Drives/cockpit-navigator/releases/download/v0.4/cockpit-navigator-0.4.5-1.el7.noarch.rpm` +1. `# yum install https://github.com/45Drives/cockpit-navigator/releases/download/v0.4/cockpit-navigator-0.4.6-1.el7.noarch.rpm` ### EL8 -1. `# dnf install https://github.com/45Drives/cockpit-navigator/releases/download/v0.4/cockpit-navigator-0.4.5-1.el8.noarch.rpm` +1. `# dnf install https://github.com/45Drives/cockpit-navigator/releases/download/v0.4/cockpit-navigator-0.4.6-1.el8.noarch.rpm` ## From Source 1. Ensure dependencies are installed: `cockpit`, `python3`, `rsync`, `zip`. 1. `$ git clone https://github.com/45Drives/cockpit-navigator.git`