Fix bug 807629 - Appmenu stays open after menu item selection (regression). r=mconley,a=Standard8
authorPhilipp Kewisch <mozilla@kewis.ch>
Sat, 03 Nov 2012 08:47:05 +0100
changeset 12554 6ffaea334b4fb5d0228d8fc0a2b3fd7010ca4c6d
parent 12553 126cfcd448fadcd56191e67f286062f62c9acf42
child 12555 68fceec2149bfbf423379030d4376baa99418c8a
push id783
push userbugzilla@standard8.plus.com
push dateMon, 12 Nov 2012 12:14:05 +0000
treeherdercomm-aurora@7ecd8dae0053 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmconley, Standard8
bugs807629
Fix bug 807629 - Appmenu stays open after menu item selection (regression). r=mconley,a=Standard8
mail/base/content/mailWidgets.xml
--- a/mail/base/content/mailWidgets.xml
+++ b/mail/base/content/mailWidgets.xml
@@ -2829,26 +2829,28 @@
     </handlers>
   </binding>
 
   <binding id="appmenu-vertical" extends="chrome://global/content/bindings/toolbarbutton.xml#menu-vertical">
     <implementation>
       <method name="_setupAppmenu">
         <parameter name="event"/>
         <body><![CDATA[
-          let appmenuPopup = document.getElementById("appmenu-popup");
-          if (this.lastChild != appmenuPopup) {
-            this.appendChild(appmenuPopup);
+          if (event.target == this) {
+              let appmenuPopup = document.getElementById("appmenu-popup");
+              if (this.lastChild != appmenuPopup) {
+                this.appendChild(appmenuPopup);
+              }
+              this.open = true;
           }
-          this.open = true;
         ]]></body>
       </method>
     </implementation>
     <handlers>
       <!-- While it would seem we could do this by handling oncommand, we can't
            because any external oncommand handlers might get called before ours,
            and then they would see the incorrect value of checked. Additionally
            a command attribute would redirect the command events anyway.-->
-      <handler event="click" button="0" action="this._setupAppmenu();"/>
-      <handler event="keypress" key=" " action="this._setupAppmenu();"/>
+      <handler event="click" button="0" action="this._setupAppmenu(event);"/>
+      <handler event="keypress" key=" " action="this._setupAppmenu(event);"/>
     </handlers>
   </binding>
 </bindings>