From 2a5e893ed7d4d7bbf708e32cd2ca4874ba236af3 Mon Sep 17 00:00:00 2001 From: Dave Townsend Date: Wed, 12 May 2010 10:26:04 -0700 Subject: [PATCH] Bug 554237: Dual vertical scrollbars if any type of add-ons exceed window area. r=unfocused --- .../mozapps/extensions/content/extensions.js | 13 +++-- .../mozapps/extensions/content/extensions.xul | 55 +++++++++---------- .../mozapps/extensions/extensions.css | 6 +- .../mozapps/extensions/extensions.css | 6 +- .../mozapps/extensions/extensions.css | 6 +- 5 files changed, 38 insertions(+), 48 deletions(-) diff --git a/toolkit/mozapps/extensions/content/extensions.js b/toolkit/mozapps/extensions/content/extensions.js index 8e7708f2c876..7adf885ed72b 100644 --- a/toolkit/mozapps/extensions/content/extensions.js +++ b/toolkit/mozapps/extensions/content/extensions.js @@ -758,11 +758,12 @@ var gSearchView = { gHeader.searchQuery = aQuery; aQuery = aQuery.trim().toLocaleLowerCase(); - while (this._listBox.itemCount > 0) - this._listBox.removeItemAt(0); + while (this._listBox.lastChild.localName == "richlistitem") + this._listBox.removeChild(this._listBox.lastChild); var self = this; AddonManager.getAddonsByTypes(null, function(aAddonsList) { + var elementCount = 0; for (let i = 0; i < aAddonsList.length; i++) { let addon = aAddonsList[i]; let score = 0; @@ -775,9 +776,10 @@ var gSearchView = { let item = createItem(addon); item.setAttribute("relevancescore", score); self._listBox.appendChild(item); + elementCount++; } - if (self._listBox.childElementCount > 0) + if (elementCount > 0) self.onSortChanged("relevancescore", false); else self.showEmptyNotice(true); @@ -831,14 +833,16 @@ var gSearchView = { showEmptyNotice: function(aShow) { this._emptyNotice.hidden = !aShow; - this._listBox.collasped = aShow; }, onSortChanged: function(aSortBy, aAscending) { + var header = this._listBox.firstChild; + this._listBox.removeChild(header); var sortService = Cc["@mozilla.org/xul/xul-sort-service;1"]. getService(Ci.nsIXULSortService); sortService.sort(this._listBox, aSortBy, aAscending ? "ascending" : "descending"); + this._listBox.insertBefore(header, this._listBox.firstChild); }, getSelectedAddon: function() { @@ -938,7 +942,6 @@ var gListView = { showEmptyNotice: function(aShow) { this._emptyNotice.hidden = !aShow; - this._listBox.collasped = aShow; }, onSortChanged: function(aSortBy, aAscending) { diff --git a/toolkit/mozapps/extensions/content/extensions.xul b/toolkit/mozapps/extensions/content/extensions.xul index 0483cc4636a4..94b3fb677940 100644 --- a/toolkit/mozapps/extensions/content/extensions.xul +++ b/toolkit/mozapps/extensions/content/extensions.xul @@ -172,25 +172,26 @@ - - - -