# HG changeset patch
# User aceman <acelists@atlas.sk>
# Date 1463457717 25200
#      Mon May 16 21:01:57 2016 -0700
# Branch THUNDERBIRD3880_2016050308_RELBRANCH
# Node ID 1ea07fd87086468f55d47b86643b41fde1496d65
# Parent  1ecec1aa0b8e2b09ed6dc29bd9e6274eda0bce52
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)

diff --git a/mail/components/addrbook/content/abEditListDialog.xul b/mail/components/addrbook/content/abEditListDialog.xul
--- 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>
diff --git a/mail/components/addrbook/content/abMailListDialog.xul b/mail/components/addrbook/content/abMailListDialog.xul
--- 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>
diff --git a/mailnews/addrbook/content/abMailListDialog.js b/mailnews/addrbook/content/abMailListDialog.js
--- a/mailnews/addrbook/content/abMailListDialog.js
+++ b/mailnews/addrbook/content/abMailListDialog.js
@@ -22,20 +22,20 @@
 
 // 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))
