Bug 554237: Dual vertical scrollbars if any type of add-ons exceed window area. r=unfocused

This commit is contained in:
Dave Townsend 2010-05-12 10:26:04 -07:00
Родитель 538d21b355
Коммит 2a5e893ed7
5 изменённых файлов: 38 добавлений и 48 удалений

Просмотреть файл

@ -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) {

Просмотреть файл

@ -172,25 +172,26 @@
<hbox id="search-sorters" class="sort-controls" sortby="name"
ascending="true"/>
</hbox>
<vbox class="list-container" flex="1">
<hbox class="search-filter">
<label value="&search.filter.label;"/>
<checkbox id="search-filter-local" checked="true" disabled="true"
label="&search.filter.installed.label;"/>
<checkbox id="search-filter-remote"
checked="false" disabled="true"
label="&search.filter.available.label;"/>
</hbox>
<vbox id="search-list-empty" class="empty-list-notice"
flex="1" hidden="true">
<spacer flex="1"/>
<label value="&listEmpty.search.label;"/>
<button label="&listEmpty.button.label;" class="addon-control"
command="cmd_goToDiscoverPane"/>
<spacer flex="3"/>
<richlistbox id="search-list" class="list" flex="1">
<vbox flex="1">
<hbox class="search-filter">
<label value="&search.filter.label;"/>
<checkbox id="search-filter-local" checked="true" disabled="true"
label="&search.filter.installed.label;"/>
<checkbox id="search-filter-remote"
checked="false" disabled="true"
label="&search.filter.available.label;"/>
</hbox>
<vbox id="search-list-empty" class="empty-list-notice"
flex="1" hidden="true">
<spacer flex="1"/>
<label value="&listEmpty.search.label;"/>
<button label="&listEmpty.button.label;" class="addon-control"
command="cmd_goToDiscoverPane"/>
<spacer flex="3"/>
</vbox>
</vbox>
<richlistbox id="search-list" class="list"/>
</vbox>
</richlistbox>
</vbox>
<!-- list view -->
@ -199,17 +200,15 @@
<hbox id="list-sorters" class="sort-controls" sortby="name"
ascending="true"/>
</hbox>
<vbox class="list-container" flex="1">
<vbox id="addon-list-empty" class="empty-list-notice"
flex="1" hidden="true">
<spacer flex="1"/>
<label value="&listEmpty.installed.label;"/>
<button label="&listEmpty.button.label;" class="addon-control"
command="cmd_goToDiscoverPane"/>
<spacer flex="3"/>
</vbox>
<richlistbox id="addon-list" class="list"/>
<vbox id="addon-list-empty" class="empty-list-notice"
flex="1" hidden="true">
<spacer flex="1"/>
<label value="&listEmpty.installed.label;"/>
<button label="&listEmpty.button.label;" class="addon-control"
command="cmd_goToDiscoverPane"/>
<spacer flex="3"/>
</vbox>
<richlistbox id="addon-list" class="list" flex="1"/>
</vbox>
<!-- detail view -->

Просмотреть файл

@ -220,10 +220,6 @@
/*** list ***/
.list-container {
overflow: auto;
}
.list {
-moz-appearance: none;
margin: 0px;
@ -398,7 +394,7 @@
/*** search view ***/
#search-view > .list-container > .search-filter {
.search-filter {
padding: 20px;
-moz-box-align: center;
background-color: #FFF;

Просмотреть файл

@ -220,10 +220,6 @@
/*** list ***/
.list-container {
overflow: auto;
}
.list {
-moz-appearance: none;
margin: 0px;
@ -398,7 +394,7 @@
/*** search view ***/
#search-view > .list-container > .search-filter {
.search-filter {
padding: 20px;
-moz-box-align: center;
background-color: #FFF;

Просмотреть файл

@ -220,10 +220,6 @@
/*** list ***/
.list-container {
overflow: auto;
}
.list {
-moz-appearance: none;
margin: 0px;
@ -398,7 +394,7 @@
/*** search view ***/
#search-view > .list-container > .search-filter {
.search-filter {
padding: 20px;
-moz-box-align: center;
background-color: #FFF;