Commit ab22fbf6 authored by Lyza Danger Gardner's avatar Lyza Danger Gardner Committed by Lyza Gardner

Position highlight controls relative to content container offset

Fixed positioning is always relative to the viewport, so set the top
position of the fixed-position highlight controls to take the integration's
content container's vertical offset from the viewport into account.

Translation: ensure that highlight controls are not obscured by PDFjs'
top menu/controls bar.
parent 1d908688
...@@ -242,9 +242,12 @@ export class Guest implements Annotator, Destroyable { ...@@ -242,9 +242,12 @@ export class Guest implements Annotator, Destroyable {
} }
if (this._integration.canStyleClusteredHighlights?.()) { if (this._integration.canStyleClusteredHighlights?.()) {
this._clusterToolbar = new HighlightClusterController(element, { this._clusterToolbar = new HighlightClusterController(
features: this.features, this._integration.contentContainer(),
}); {
features: this.features,
}
);
} }
this._hostRPC = new PortRPC(); this._hostRPC = new PortRPC();
......
...@@ -77,7 +77,7 @@ export class HighlightClusterController implements Destroyable { ...@@ -77,7 +77,7 @@ export class HighlightClusterController implements Destroyable {
// For now, the controls are fixed at top-left of screen. This is temporary. // For now, the controls are fixed at top-left of screen. This is temporary.
Object.assign(this._outerContainer.style, { Object.assign(this._outerContainer.style, {
position: 'fixed', position: 'fixed',
top: '4px', top: `${this._element.offsetTop + 4}px`,
left: '4px', left: '4px',
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment