From 1f50e1c476a287692847d7d8f94a903517b727a7 Mon Sep 17 00:00:00 2001 From: janekptacijarabaci Date: Sun, 24 Jun 2018 12:18:48 +0200 Subject: Preferences - Saved Passwords - "Remove" button should not be active if there are no items --- toolkit/components/passwordmgr/content/passwordManager.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolkit/components/passwordmgr/content/passwordManager.js b/toolkit/components/passwordmgr/content/passwordManager.js index da63d7de8..bd5cebfc4 100644 --- a/toolkit/components/passwordmgr/content/passwordManager.js +++ b/toolkit/components/passwordmgr/content/passwordManager.js @@ -326,7 +326,7 @@ function LoadSignons() { function GetTreeSelections() { let selections = []; let select = signonsTree.view.selection; - if (select) { + if (select && signonsTree.view.rowCount > 0) { let count = select.getRangeCount(); let min = {}; let max = {}; -- cgit v1.2.3 From 640f9ed3a5165b87644aa40342c62bc17f3ec4d7 Mon Sep 17 00:00:00 2001 From: janekptacijarabaci Date: Sun, 24 Jun 2018 12:20:08 +0200 Subject: Preferences - Show Cookies - "Remove Selected" button should not be active if there are no items --- application/basilisk/components/preferences/cookies.js | 4 +++- application/palemoon/components/preferences/cookies.js | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/application/basilisk/components/preferences/cookies.js b/application/basilisk/components/preferences/cookies.js index 921eee4c0..3529a4159 100644 --- a/application/basilisk/components/preferences/cookies.js +++ b/application/basilisk/components/preferences/cookies.js @@ -565,6 +565,8 @@ var gCookiesWindow = { onCookieSelected: function () { var item; var seln = this._tree.view.selection; + var hasRows = this._tree.view.rowCount > 0; + var hasSelection = seln.count > 0; if (!this._view._filtered) item = this._view._getItemAtIndex(seln.currentIndex); else @@ -592,7 +594,7 @@ var gCookiesWindow = { removeSelectedCookies.label = PluralForm.get(selectedCookieCount, buttonLabel) .replace("#1", selectedCookieCount); - removeSelectedCookies.disabled = !(seln.count > 0); + removeSelectedCookies.disabled = !hasRows || !hasSelection; }, performDeletion: function gCookiesWindow_performDeletion(deleteItems) { diff --git a/application/palemoon/components/preferences/cookies.js b/application/palemoon/components/preferences/cookies.js index 4ef30d48e..74ec3d1d2 100644 --- a/application/palemoon/components/preferences/cookies.js +++ b/application/palemoon/components/preferences/cookies.js @@ -540,6 +540,8 @@ var gCookiesWindow = { onCookieSelected: function () { var properties, item; var seln = this._tree.view.selection; + var hasRows = this._tree.view.rowCount > 0; + var hasSelection = seln.count > 0; if (!this._view._filtered) item = this._view._getItemAtIndex(seln.currentIndex); else @@ -570,7 +572,7 @@ var gCookiesWindow = { removeSelectedCookies.label = PluralForm.get(selectedCookieCount, buttonLabel) .replace("#1", selectedCookieCount); - removeSelectedCookies.disabled = !(seln.count > 0); + removeSelectedCookies.disabled = !hasRows || !hasSelection; }, performDeletion: function gCookiesWindow_performDeletion(deleteItems) { -- cgit v1.2.3 From 491fc99b92df22595ab6667bb9de0de989f58ab1 Mon Sep 17 00:00:00 2001 From: janekptacijarabaci Date: Sun, 24 Jun 2018 12:25:14 +0200 Subject: Preferences - Show Cookies - /"onCookieSelected" is not fired twice --- application/basilisk/components/preferences/cookies.js | 4 +++- application/palemoon/components/preferences/cookies.js | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/application/basilisk/components/preferences/cookies.js b/application/basilisk/components/preferences/cookies.js index 3529a4159..c420855f8 100644 --- a/application/basilisk/components/preferences/cookies.js +++ b/application/basilisk/components/preferences/cookies.js @@ -808,7 +808,9 @@ var gCookiesWindow = { this._view._invalidateCache(0); this._view.selection.clearSelection(); - this._view.selection.select(0); + if (this._view.rowCount > 0) { + this._view.selection.select(0); + } this._tree.treeBoxObject.invalidate(); this._tree.treeBoxObject.ensureRowIsVisible(0); diff --git a/application/palemoon/components/preferences/cookies.js b/application/palemoon/components/preferences/cookies.js index 74ec3d1d2..4fa47ee4e 100644 --- a/application/palemoon/components/preferences/cookies.js +++ b/application/palemoon/components/preferences/cookies.js @@ -788,7 +788,9 @@ var gCookiesWindow = { this._view._invalidateCache(0); this._view.selection.clearSelection(); - this._view.selection.select(0); + if (this._view.rowCount > 0) { + this._view.selection.select(0); + } this._tree.treeBoxObject.invalidate(); this._tree.treeBoxObject.ensureRowIsVisible(0); -- cgit v1.2.3