Bug 431842: refactor autocomplete binding to support Fennec autocomplete, r=gavin

This commit is contained in:
Neil Deakin 2008-07-16 18:16:52 +02:00
Родитель 748d1b253a
Коммит c9dba67e3d
2 изменённых файлов: 126 добавлений и 117 удалений

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

@ -1294,6 +1294,13 @@ nsAutoCompleteController::PostSearchCleanup()
mSearchStatus = nsIAutoCompleteController::STATUS_COMPLETE_MATCH;
} else {
mSearchStatus = nsIAutoCompleteController::STATUS_COMPLETE_NO_MATCH;
PRUint32 minResults;
mInput->GetMinResultsForPopup(&minResults);
if (minResults == 0) {
// check if the popup may be opened even when there are no results
mIsOpen = PR_TRUE;
return mInput->SetPopupOpen(PR_TRUE);
}
ClosePopup();
}

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

@ -142,7 +142,7 @@
<property name="minResultsForPopup"
onset="this.setAttribute('minresultsforpopup', val); return val;"
onget="return parseInt(this.getAttribute('minresultsforpopup')) || 0;"/>
onget="var m = parseInt(this.getAttribute('minresultsforpopup')); return isNaN(m) ? 1 : m;"/>
<property name="showCommentColumn"
onset="this.setAttribute('showcommentcolumn', val); return val;"
@ -902,6 +902,9 @@
<content ignorekeys="true">
<xul:richlistbox anonid="richlistbox" class="autocomplete-richlistbox" flex="1"/>
<xul:hbox>
<children/>
</xul:hbox>
</content>
<implementation implements="nsIAutoCompletePopup">
@ -1159,7 +1162,7 @@
class="ac-ellipsis-after ac-comment" hidden="true"/>
<xul:image anonid="type-image" class="ac-type-icon"/>
</xul:hbox>
<xul:hbox align="center">
<xul:hbox align="center" class="ac-url-box">
<xul:spacer class="ac-site-icon"/>
<xul:hbox anonid="url-box" class="ac-url" flex="1"
onunderflow="_doUnderflow('_url');">
@ -1582,4 +1585,3 @@
</binding>
</bindings>