diff options
author | Gaming4JC <g4jc@bulletmail.org> | 2018-06-24 09:42:10 -0400 |
---|---|---|
committer | Gaming4JC <g4jc@bulletmail.org> | 2018-06-24 09:42:10 -0400 |
commit | bf4118385cfb2835008909732cddb4b2fb4e450e (patch) | |
tree | 4788856f308fe9ef59e41cbee742295b91d3cd7d | |
parent | 28adc8107e90373c0c8f3cb07ae5470bf6135074 (diff) | |
download | iceweasel-uxp-bf4118385cfb2835008909732cddb4b2fb4e450e.tar.gz |
backport: Preferences - Show Cookies - Remove Selected button should not be active if there are no items
-rw-r--r-- | components/preferences/cookies.js | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/components/preferences/cookies.js b/components/preferences/cookies.js index 921eee4..c420855 100644 --- a/components/preferences/cookies.js +++ b/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) { @@ -806,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); |