Bug 300074 - Disable actions when no items are selected in the Download Actions and Cookie Manager dialogs. patch from Caleb <bugs.caleb@gmail.com>, r=mconnor, a=asa.

git-svn-id: svn://10.0.0.236/trunk@176030 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
mozilla.mano%sent.com 2005-07-13 18:50:25 +00:00
parent b2311f9559
commit 56b34c73b3
2 changed files with 12 additions and 3 deletions

View File

@ -845,7 +845,10 @@ var gCookiesWindow = {
view._rowCount = view._filterSet.length;
gCookiesWindow._tree.treeBoxObject.rowCountChanged(0, view.rowCount);
view.selection.select(0);
// if the view is not empty then select the first item
if (view.rowCount > 0)
view.selection.select(0);
document.getElementById("cookiesIntro").value = gCookiesWindow._bundle.getString("cookiesFiltered");
document.getElementById("clearFilter").disabled = false;
}

View File

@ -662,8 +662,11 @@ var gDownloadActionsWindow = {
onSelectionChanged: function ()
{
if (this._tree.view.rowCount == 0)
if (this._tree.view.rowCount == 0) {
this._removeButton.disabled = true;
this._editButton.disabled = true;
return;
}
var selection = this._tree.view.selection;
var selected = selection.count;
@ -822,7 +825,10 @@ var gDownloadActionsWindow = {
// Clear the display
gDownloadActionsWindow._updateRowCount(view._filterSet.length);
view.selection.select(0);
// if the view is not empty then select the first item
if (view.rowCount > 0)
view.selection.select(0);
document.getElementById("actionsIntro").value = gDownloadActionsWindow._bundle.getString("actionsFiltered");
document.getElementById("clearFilter").disabled = false;
}