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 13549 53faaeb4d17e9a41635c4116b61069f45d091a9d
parent 13548 e88cf81c4b65ff67f2d28f97441e52a59258e535
child 13550 82fcebdc15e2eeeb6e34f4cf0fc3da8dc4c1a958
push id3
push userbugzilla@standard8.plus.com
push dateFri, 16 Nov 2012 10:54:06 +0000
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
@@ -2832,26 +2832,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>