Bug 591071: Recent updates category is hidden if it is the selected category when the add-ons manager is opened. r=Unfocused, a=blocks-final
authorDave Townsend <dtownsend@oxymoronical.com>
Mon, 08 Nov 2010 09:58:38 -0800
changeset 57118 d73fe0475b748f332cd4a6f91fc0a9ce5ff88335
parent 57117 bfda707be9fb63b9498282aee0268777b5332a4d
child 57119 25f346a28ba8b268fb7a3ebac93d1a27f4fbae9b
push id1
push usershaver@mozilla.com
push dateTue, 04 Jan 2011 17:58:04 +0000
reviewersUnfocused, blocks-final
bugs591071
milestone2.0b8pre
Bug 591071: Recent updates category is hidden if it is the selected category when the add-ons manager is opened. r=Unfocused, a=blocks-final
toolkit/mozapps/extensions/content/extensions.js
toolkit/mozapps/extensions/test/browser/browser_recentupdates.js
--- a/toolkit/mozapps/extensions/content/extensions.js
+++ b/toolkit/mozapps/extensions/content/extensions.js
@@ -1297,18 +1297,21 @@ var gCategories = {
   select: function(aId, aPreviousView) {
     var view = gViewController.parseViewId(aId);
     if (view.type == "detail") {
       aId = aPreviousView;
       view = gViewController.parseViewId(aPreviousView);
     }
 
     if (this.node.selectedItem &&
-        this.node.selectedItem.value == aId)
+        this.node.selectedItem.value == aId) {
+      this.node.selectedItem.hidden = false;
+      this.node.selectedItem.disabled = false;
       return;
+    }
 
     if (view.type == "search")
       var item = this._search;
     else
       var item = this.get(aId);
 
     if (item) {
       item.hidden = false;
--- a/toolkit/mozapps/extensions/test/browser/browser_recentupdates.js
+++ b/toolkit/mozapps/extensions/test/browser/browser_recentupdates.js
@@ -79,8 +79,23 @@ add_test(function() {
     is(itemId, expected.shift(), "Should get expected item based on recenty of update");
     if (itemId == "addon1@tests.mozilla.org")
       is_element_visible(item._relNotesToggle, "Release notes toggle should be visible for addon with release notes");
     else
       is_element_hidden(item._relNotesToggle, "Release notes toggle should be hidden for addon with no release notes");
   }
   run_next_test();
 });
+
+
+add_test(function() {
+  close_manager(gManagerWindow, function() {
+    open_manager(null, function(aWindow) {
+      gManagerWindow = aWindow;
+      gCategoryUtilities = new CategoryUtilities(gManagerWindow);
+
+      var recentCat = gManagerWindow.gCategories.get("addons://updates/recent");
+      is(gCategoryUtilities.isVisible(recentCat), true, "Recent Updates category should still be visible");
+
+      run_next_test();
+    });
+  });
+});