Bug 1349416 - Prevent event tooltip from reappearing when clicking on bubble draft
authorJulian Descottes <jdescottes@mozilla.com>
Fri, 27 Jul 2018 07:27:29 +0200
changeset 823384 55dad46ddd0d8ba80d61a22894bee20ab9cc56d6
parent 823383 45e83891e66aa0d5c271cd0fb8909c09dfafb64d
child 823385 05b463a8cd72529b609a5c859f64091150f0cfb9
push id117656
push userjdescottes@mozilla.com
push dateFri, 27 Jul 2018 05:57:05 +0000
bugs1349416
milestone63.0a1
Bug 1349416 - Prevent event tooltip from reappearing when clicking on bubble MozReview-Commit-ID: ChGb3DPBPI8
devtools/client/inspector/markup/views/element-container.js
--- a/devtools/client/inspector/markup/views/element-container.js
+++ b/devtools/client/inspector/markup/views/element-container.js
@@ -65,16 +65,17 @@ MarkupElementContainer.prototype = exten
     MarkupContainer.prototype.destroy.call(this);
   },
 
   onContainerClick: function(event) {
     if (!event.target.hasAttribute("data-event")) {
       return;
     }
 
+    this.editor.eventBadge.style.pointerEvents = "none";
     this._buildEventTooltipContent(event.target);
   },
 
   /**
    * Handler for "flexbox-highlighter-hidden" and "flexbox-highlighter-shown" event
    * emitted from the HighlightersOverlay. Toggles the active state of the display badge
    * if it matches the highlighted flex container node.
    */
@@ -90,29 +91,33 @@ MarkupElementContainer.prototype = exten
    */
   onGridHighlighterChange: function() {
     this.editor.displayBadge.classList.toggle("active",
       this.markup.highlighters.gridHighlighterShown === this.node);
   },
 
   async _buildEventTooltipContent(target) {
     const tooltip = this.markup.eventDetailsTooltip;
-
     await tooltip.hide();
 
     const listenerInfo = await this.node.getEventListenerInfo();
 
     const toolbox = this.markup.toolbox;
 
     setEventTooltip(tooltip, listenerInfo, toolbox);
     // Disable the image preview tooltip while we display the event details
     this.markup._disableImagePreviewTooltip();
     tooltip.once("hidden", () => {
       // Enable the image preview tooltip after closing the event details
       this.markup._enableImagePreviewTooltip();
+      this.markup.win.setTimeout(() => {
+        if (this.editor.eventBadge) {
+          this.editor.eventBadge.style.pointerEvents = "auto";
+        }
+      }, 0);
     });
     tooltip.show(target);
   },
 
   /**
    * Generates the an image preview for this Element. The element must be an
    * image or canvas (@see isPreviewable).
    *