Bug 1272505 - rename handleKeyPress() in maillist list editor to not clash with the function in autocomplete.xml. r=jorgk, r=Ratty a=rkent (no suite changes)
authoraceman <acelists@atlas.sk>
Mon, 16 May 2016 20:59:54 -0700
changeset 27029 9f93a68b0d43739dccf149c044a77416e71a0523
parent 27028 03e9226caa2178e44704ac8d10899380e9532088
child 27030 404d608565212ea62df425703bccff782ecbf693
push id1850
push userclokep@gmail.com
push dateWed, 08 Mar 2017 19:29:12 +0000
treeherdercomm-esr52@028df196b2d9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjorgk, Ratty, rkent
bugs1272505
Bug 1272505 - rename handleKeyPress() in maillist list editor to not clash with the function in autocomplete.xml. r=jorgk, r=Ratty a=rkent (no suite changes)
mail/components/addrbook/content/abEditListDialog.xul
mail/components/addrbook/content/abMailListDialog.xul
mailnews/addrbook/content/abMailListDialog.js
--- a/mail/components/addrbook/content/abEditListDialog.xul
+++ b/mail/components/addrbook/content/abEditListDialog.xul
@@ -57,17 +57,17 @@
         <listcell class="addressingWidgetCell">
           <textbox id="addressCol1#1" class="plain textbox-addressingWidget uri-element"
                    type="autocomplete" flex="1"
                    autocompletesearch="addrbook ldap"
                    autocompletesearchparam="{}" timeout="300" maxrows="4"
                    completedefaultindex="true" forcecomplete="true"
                    minresultsforpopup="3"
                    ontextentered="awRecipientTextCommand(param, this)"
-                   onkeypress="handleKeyPress(this, event);"
+                   onkeypress="awHandleKeyPress(this, event);"
                    onkeydown="awRecipientKeyDown(event, this);"
                    onclick="awNotAnEmptyArea(event);">
             <image onclick="this.parentNode.select();" class="person-icon"/>
           </textbox>
         </listcell>
       </listitem>
     </listbox>
   </vbox>
--- a/mail/components/addrbook/content/abMailListDialog.xul
+++ b/mail/components/addrbook/content/abMailListDialog.xul
@@ -67,17 +67,17 @@
         <listcell class="addressingWidgetCell">
           <textbox id="addressCol1#1" class="plain textbox-addressingWidget uri-element"
                    type="autocomplete" flex="1"
                    autocompletesearch="addrbook ldap"
                    autocompletesearchparam="{}" timeout="300" maxrows="4"
                    completedefaultindex="true" forcecomplete="true"
                    minresultsforpopup="3"
                    ontextentered="awRecipientTextCommand(param, this)"
-                   onkeypress="handleKeyPress(this, event);"
+                   onkeypress="awHandleKeyPress(this, event);"
                    onkeydown="awRecipientKeyDown(event, this);"
                    onclick="awNotAnEmptyArea(event);">
             <image onclick="this.parentNode.select();" class="person-icon"/>
           </textbox>
         </listcell>
       </listitem>
     </listbox>
   </vbox>
--- a/mailnews/addrbook/content/abMailListDialog.js
+++ b/mailnews/addrbook/content/abMailListDialog.js
@@ -22,20 +22,20 @@ catch (e)
 
 // Returns the load context for the current window
 function getLoadContext() {
   return window.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
                .getInterface(Components.interfaces.nsIWebNavigation)
                .QueryInterface(Components.interfaces.nsILoadContext);
 }
 
-function handleKeyPress(element, event)
+function awHandleKeyPress(element, event)
 {
   // allow dialog to close on enter if focused textbox has no value
-  if (element.value != "" && event.keyCode == 13) {
+  if (element.value != "" && event.keyCode == KeyEvent.DOM_VK_RETURN) {
     event.stopPropagation();
     event.preventDefault();
   }
 }
 
 function mailingListExists(listname)
 {
   if (MailServices.ab.mailListNameExists(listname))