mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-20 00:35:44 +00:00
Bug 1085330 - UITour: Highlight positioning breaks when icon target moves into "more tools" overflow panel. r=Unfocused
This commit is contained in:
parent
5da38c25ef
commit
d1e334365e
@ -838,7 +838,17 @@ this.UITour = {
|
||||
highlighter.parentElement.setAttribute("targetName", aTarget.targetName);
|
||||
highlighter.parentElement.hidden = false;
|
||||
|
||||
let targetRect = aTarget.node.getBoundingClientRect();
|
||||
let highlightAnchor;
|
||||
// If the target is in the overflow panel, just highlight the overflow button.
|
||||
if (aTarget.node.getAttribute("overflowedItem")) {
|
||||
let doc = aTarget.node.ownerDocument;
|
||||
let placement = CustomizableUI.getPlacementOfWidget(aTarget.widgetName || aTarget.node.id);
|
||||
let areaNode = doc.getElementById(placement.area);
|
||||
highlightAnchor = areaNode.overflowable._chevron;
|
||||
} else {
|
||||
highlightAnchor = aTarget.node;
|
||||
}
|
||||
let targetRect = highlightAnchor.getBoundingClientRect();
|
||||
let highlightHeight = targetRect.height;
|
||||
let highlightWidth = targetRect.width;
|
||||
let minDimension = Math.min(highlightHeight, highlightWidth);
|
||||
@ -874,7 +884,7 @@ this.UITour = {
|
||||
let offsetY = paddingLeftPx
|
||||
- (Math.max(0, highlightHeightWithMin - targetRect.height) / 2);
|
||||
this._addAnnotationPanelMutationObserver(highlighter.parentElement);
|
||||
highlighter.parentElement.openPopup(aTarget.node, "overlap", offsetX, offsetY);
|
||||
highlighter.parentElement.openPopup(highlightAnchor, "overlap", offsetX, offsetY);
|
||||
}
|
||||
|
||||
// Prevent showing a panel at an undefined position.
|
||||
|
Loading…
Reference in New Issue
Block a user