Bug 1284259 - Prevent exception while dismissing event tooltip details. r=jdescottes

MozReview-Commit-ID: 4BjCwSv8QdB

--HG--
extra : rebase_source : edb30ed54f56df4e86f07de92f37657263d3ced0
This commit is contained in:
Alexandre Poirot 2016-07-13 13:15:01 +02:00
Родитель 14cb1ca969
Коммит 40b35eb1d4
1 изменённых файлов: 13 добавлений и 15 удалений

Просмотреть файл

@ -2645,25 +2645,23 @@ function MarkupElementContainer(markupView, node) {
}
MarkupElementContainer.prototype = Heritage.extend(MarkupContainer.prototype, {
_buildEventTooltipContent: function (target, tooltip) {
_buildEventTooltipContent: Task.async(function* (target, tooltip) {
if (target.hasAttribute("data-event")) {
tooltip.hide(target);
yield tooltip.hide();
this.node.getEventListenerInfo().then(listenerInfo => {
let toolbox = this.markup._inspector.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();
});
tooltip.show(target);
let listenerInfo = yield this.node.getEventListenerInfo();
let toolbox = this.markup._inspector.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();
});
return true;
tooltip.show(target);
}
return undefined;
},
}),
/**
* Generates the an image preview for this Element. The element must be an