Bug 1285206 - Enable xul panel for some devtools tooltips;r=bgrins

Set useXulWrapper to true for markup view image previews and rule view
tooltips.

Also slightly changed the logic in HTMLTooltip.js so that useXulWrapper is only
true when we are in a XUL context.

MozReview-Commit-ID: 9EkQYLLAn7C

--HG--
extra : rebase_source : 5b096345c087a85f3c66fdca639287196e22775c
This commit is contained in:
Julian Descottes 2016-07-08 15:46:42 +02:00
parent 6dbdb73654
commit d1025c9eea
3 changed files with 5 additions and 4 deletions

View File

@ -172,7 +172,7 @@ MarkupView.prototype = {
this.eventDetailsTooltip = new HTMLTooltip(this._inspector.toolbox,
{type: "arrow"});
this.imagePreviewTooltip = new HTMLTooltip(this._inspector.toolbox,
{type: "arrow"});
{type: "arrow", useXulWrapper: "true"});
this._enableImagePreviewTooltip();
},

View File

@ -280,7 +280,8 @@ TooltipsOverlay.prototype = {
// Image, fonts, ... preview tooltip
this.previewTooltip = new HTMLTooltip(this.view.inspector.toolbox, {
type: "arrow"
type: "arrow",
useXulWrapper: true
});
this.previewTooltip.startTogglingOnHover(this.view.element,
this._onPreviewTooltipTargetHover.bind(this));

View File

@ -211,7 +211,7 @@ function HTMLTooltip(toolbox, {
this.type = type;
this.autofocus = autofocus;
this.consumeOutsideClicks = consumeOutsideClicks;
this.useXulWrapper = useXulWrapper;
this.useXulWrapper = this._isXUL() && useXulWrapper;
this._position = null;
@ -229,7 +229,7 @@ function HTMLTooltip(toolbox, {
if (stylesheet) {
this._applyStylesheet(stylesheet);
}
if (this._isXUL() && this.useXulWrapper) {
if (this.useXulWrapper) {
// When using a XUL panel as the wrapper, the actual markup for the tooltip is as
// follows :
// <panel> <!-- XUL panel used to position the tooltip anywhere on screen -->