зеркало из https://github.com/mozilla/pjs.git
Typing should deselect autocomplete search engine b=79069 r=KaiRo sr=jag
This commit is contained in:
Родитель
c014ee66c2
Коммит
05edfdbd73
|
@ -278,6 +278,13 @@
|
|||
]]></body>
|
||||
</method>
|
||||
|
||||
<method name="clearSelection">
|
||||
<body>
|
||||
this.view.selection.clearSelection();
|
||||
this.mSearchBox.selectedIndex = -1;
|
||||
</body>
|
||||
</method>
|
||||
|
||||
<method name="selectBy">
|
||||
<parameter name="aReverse"/>
|
||||
<parameter name="aPage"/>
|
||||
|
@ -345,22 +352,6 @@
|
|||
-1
|
||||
</field>
|
||||
|
||||
<field name="parentMouseoverListener">
|
||||
// ensure that if a result menuitem is moused-over, any
|
||||
// search selection is cleared
|
||||
(function(aEvent) {
|
||||
if (aEvent.target.nodeName == "menuitem")
|
||||
this.mSearchBox.selectedIndex = -1;
|
||||
})
|
||||
</field>
|
||||
|
||||
<field name="parentDestroyListener">
|
||||
// ensure that if the popup closes, any search selection is cleared
|
||||
(function(aEvent) {
|
||||
this.mSearchBox.selectedIndex = -1;
|
||||
})
|
||||
</field>
|
||||
|
||||
<property name="activeChild"
|
||||
onget="return this.childNodes[this.mSelectedIndex]"/>
|
||||
|
||||
|
@ -373,16 +364,8 @@
|
|||
|
||||
this.mSelectedIndex = val;
|
||||
|
||||
if (val != -1) {
|
||||
this.parentNode.mSelectedIndex = -1;
|
||||
this.parentNode.addEventListener("mouseover", this.parentMouseoverListener, false);
|
||||
this.parentNode.addEventListener("popuphiding", this.parentDestroyListener, false);
|
||||
if (this.activeChild)
|
||||
this.activeChild.setAttribute("menuactive", "true");
|
||||
} else {
|
||||
this.parentNode.removeEventListener("mouseover", this.parentMouseoverListener, false);
|
||||
this.parentNode.removeEventListener("popuphiding", this.parentDestroyListener, false);
|
||||
}
|
||||
if (val != -1)
|
||||
this.activeChild.setAttribute("menuactive", "true");
|
||||
return val;
|
||||
]]></setter>
|
||||
|
||||
|
|
|
@ -907,7 +907,7 @@
|
|||
this.mNeedToComplete = true;
|
||||
var str = this.value;
|
||||
this.currentSearchString = str;
|
||||
this.resultsPopup.selectedIndex = -1;
|
||||
this.resultsPopup.clearSelection();
|
||||
this.removeAttribute("noMatchesFound");
|
||||
|
||||
this.mAutoCompleteTimer = setTimeout(this.callListener, this.timeout, this, "startLookup");
|
||||
|
@ -1479,6 +1479,12 @@
|
|||
]]></body>
|
||||
</method>
|
||||
|
||||
<method name="clearSelection">
|
||||
<body>
|
||||
this.view.selection.clearSelection();
|
||||
</body>
|
||||
</method>
|
||||
|
||||
<method name="selectBy">
|
||||
<parameter name="aReverse"/>
|
||||
<parameter name="aPage"/>
|
||||
|
@ -1532,14 +1538,14 @@
|
|||
|
||||
<property name="selectedIndex">
|
||||
<getter>
|
||||
if (!this.view || !this.view.selection || !this.view.selection.count)
|
||||
if (!this.view || !this.view.selection.count)
|
||||
return -1;
|
||||
var start = {}, end = {};
|
||||
this.view.selection.getRangeAt(0, start, end);
|
||||
return start.value;
|
||||
</getter>
|
||||
<setter><![CDATA[
|
||||
if (this.view && this.view.selection) {
|
||||
<setter>
|
||||
if (this.view) {
|
||||
this.view.selection.select(val);
|
||||
if (val >= 0) {
|
||||
this.view.selection.currentIndex = -1;
|
||||
|
@ -1547,7 +1553,7 @@
|
|||
}
|
||||
}
|
||||
return val;
|
||||
]]></setter>
|
||||
</setter>
|
||||
</property>
|
||||
|
||||
<property name="popupOpen" onget="return !!this.input;" readonly="true"/>
|
||||
|
@ -1595,7 +1601,7 @@
|
|||
<handler event="popuphiding">
|
||||
if (this.textbox)
|
||||
this.textbox.mMenuOpen = false;
|
||||
this.selectedIndex = -1;
|
||||
this.clearSelection();
|
||||
this.input = null;
|
||||
</handler>
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче