Bug 903294 - Work - NewUI - Hide entire "Your Results" section when there are no autocomplete results. r=mbrubeck

--HG--
extra : rebase_source : 71860ebe8e5aa0d84c294133427f148b5eb4006d
This commit is contained in:
Jonathan Wilde 2013-08-08 23:38:31 -07:00
parent 7377a58c51
commit 526b57dd3c

View File

@ -485,7 +485,7 @@
<binding id="urlbar-autocomplete">
<content orient="horizontal">
<xul:vbox id="results-vbox" flex="1">
<xul:vbox id="results-vbox" anonid="results-container" flex="1">
<xul:label class="meta-section-title" value="&autocompleteResultsHeader.label;"/>
<richgrid id="results-richgrid" rows="3" deferlayout="true" anonid="results" seltype="single" flex="1"/>
</xul:vbox>
@ -590,7 +590,10 @@
<!-- Updating grid content -->
<field name="_grid">null</field>
<field name="_results" readonly="true">document.getAnonymousElementByAttribute(this, 'anonid', 'results');</field>
<field name="_resultsContainer" readonly="true">document.getAnonymousElementByAttribute(this, 'anonid', 'results-container');</field>
<field name="_searches" readonly="true">document.getAnonymousElementByAttribute(this, 'anonid', 'searches');</field>
<property name="_otherGrid" readonly="true">
@ -636,6 +639,13 @@
if (!this.input)
return;
let haveNoResults = (this.matchCount == 0);
this._resultsContainer.hidden = haveNoResults;
if (haveNoResults) {
return;
}
let controller = this.input.controller;
let lastMatch = this.matchCount - 1;
let iterCount = Math.max(this._results.itemCount, this.matchCount);