summaryrefslogtreecommitdiffstats
path: root/application
diff options
context:
space:
mode:
Diffstat (limited to 'application')
-rw-r--r--application/basilisk/components/preferences/cookies.js8
-rw-r--r--application/palemoon/components/preferences/cookies.js8
2 files changed, 12 insertions, 4 deletions
diff --git a/application/basilisk/components/preferences/cookies.js b/application/basilisk/components/preferences/cookies.js
index 921eee4c0..c420855f8 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) {
@@ -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);
diff --git a/application/palemoon/components/preferences/cookies.js b/application/palemoon/components/preferences/cookies.js
index 4ef30d48e..4fa47ee4e 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) {
@@ -786,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);