Bug 270128 Menu access key should close autocomplete r=aaronlev,ajschult [p=Neil]

(from) Bug 443837 - Get SeaMonkey/Thunderbird patches from cvs trunk into mozilla-central
This commit is contained in:
Justin Wood 2008-07-08 00:59:45 -04:00
parent afd2789dc8
commit fcf9864051

View File

@ -376,6 +376,12 @@
document.getAnonymousElementByAttribute(this, "anonid", "input"); document.getAnonymousElementByAttribute(this, "anonid", "input");
]]></field> ]]></field>
<field name="mMenuAccessKey"><![CDATA[
Components.classes["@mozilla.org/preferences-service;1"]
.getService(Components.interfaces.nsIPrefBranch)
.getIntPref("ui.key.menuAccessKey");
]]></field>
<!-- =================== PUBLIC METHODS =================== --> <!-- =================== PUBLIC METHODS =================== -->
<!-- get the result object from the autocomplete results from a specific session --> <!-- get the result object from the autocomplete results from a specific session -->
@ -915,6 +921,18 @@
]]></body> ]]></body>
</method> </method>
<!-- -->
<method name="processKeyDown">
<parameter name="aEvent"/>
<body><![CDATA[
if (aEvent.keyCode && aEvent.keyCode == this.mMenuAccessKey) {
this.finishAutoComplete(false, false, aEvent);
this.clearTimer();
this.closeResultPopup();
}
]]></body>
</method>
<!-- --> <!-- -->
<method name="processKeyPress"> <method name="processKeyPress">
<parameter name="aEvent"/> <parameter name="aEvent"/>
@ -1387,6 +1405,9 @@
<handler event="input" <handler event="input"
action="this.processInput();"/> action="this.processInput();"/>
<handler event="keydown" phase="capturing"
action="return this.processKeyDown(event);"/>
<handler event="keypress" phase="capturing" <handler event="keypress" phase="capturing"
action="return this.processKeyPress(event);"/> action="return this.processKeyPress(event);"/>