Bug 461252 - First filter in Message Filters should be selected; r=mkmelin+mozilla sr=bienvenu
authorJeff Beckley <beckley@qualcomm.com>
Wed, 29 Oct 2008 03:21:30 +0100
changeset 751 e81e3f13af0e0a630bb675a5d38877c0a7098103
parent 750 cb1cabceabff0128ed350a6ef007c7d59d5e98b6
child 752 efd446a5a224268e2307d7a52682b750db80cef4
push idunknown
push userunknown
push dateunknown
reviewersmkmelin, bienvenu
bugs461252
Bug 461252 - First filter in Message Filters should be selected; r=mkmelin+mozilla sr=bienvenu
mail/base/content/FilterListDialog.js
--- a/mail/base/content/FilterListDialog.js
+++ b/mail/base/content/FilterListDialog.js
@@ -150,16 +150,21 @@ function setFolder(msgFolder)
 {
    if (msgFolder == gCurrentFolder)
      return;
 
    //Calling getFilterList will detect any errors in rules.dat, backup the file, and alert the user
    var filterList = msgFolder.getFilterList(gFilterListMsgWindow);
    rebuildFilterList(filterList);
 
+   // Select the first item in the list, if there is one.
+   var list = document.getElementById("filterList");
+   if (list.getRowCount())
+     list.selectItem(list.getItemAtIndex(0));
+
    // root the folder picker to this server
    var runMenu = document.getElementById("runFiltersPopup");
    runMenu._teardown();
    runMenu._parentFolder = msgFolder;
    runMenu._ensureInitialized();
 
    // run filters after the fact not supported by news
    if (CanRunFiltersAfterTheFact(msgFolder.server)) {