From f82c781d1a5b870865797ac64a3f2e81843793cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A3o=20Gottwald?= Date: Tue, 17 Mar 2009 14:08:07 +0100 Subject: [PATCH] Bug 483370 - Buttons on Security tab are broken when windows are already open. r=mconnor --- browser/components/preferences/cookies.js | 14 +++++++++----- .../passwordmgr/content/passwordManager.js | 14 +++++++++----- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/browser/components/preferences/cookies.js b/browser/components/preferences/cookies.js index 4dfcb27474ca..fe9291c4c678 100644 --- a/browser/components/preferences/cookies.js +++ b/browser/components/preferences/cookies.js @@ -79,11 +79,10 @@ var gCookiesWindow = { this._tree.view.selection.select(0); if (aInitialLoad) { - if ("arguments" in window && window.arguments[0] && - window.arguments[0].filterString) { - document.getElementById("filter").value = window.arguments[0].filterString; - this.filter(); - } + if ("arguments" in window && + window.arguments[0] && + window.arguments[0].filterString) + this.setFilter(window.arguments[0].filterString); } else { if (document.getElementById("filter").value != "") @@ -887,6 +886,11 @@ var gCookiesWindow = { document.getElementById("cookiesIntro").value = gCookiesWindow._bundle.getString("cookiesFiltered"); }, + setFilter: function (aFilterString) { + document.getElementById("filter").value = aFilterString; + this.filter(); + }, + focusFilterBox: function () { var filter = document.getElementById("filter"); filter.focus(); diff --git a/toolkit/components/passwordmgr/content/passwordManager.js b/toolkit/components/passwordmgr/content/passwordManager.js index 699d1e711afa..1a26ad3588e9 100644 --- a/toolkit/components/passwordmgr/content/passwordManager.js +++ b/toolkit/components/passwordmgr/content/passwordManager.js @@ -53,15 +53,19 @@ function SignonsStartup() { LoadSignons(); // filter the table if requested by caller - if (window.arguments && window.arguments[0] && - window.arguments[0].filterString) { - document.getElementById("filter").value = window.arguments[0].filterString; - _filterPasswords(); - } + if (window.arguments && + window.arguments[0] && + window.arguments[0].filterString) + setFilter(window.arguments[0].filterString); FocusFilterBox(); } +function setFilter(aFilterString) { + document.getElementById("filter").value = aFilterString; + _filterPasswords(); +} + var signonsTreeView = { _filterSet : [], _lastSelectedRanges : [],