-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PATCH: fix: use new viewer apis to handle viewpoints
- Loading branch information
1 parent
8ebb48e
commit 1b71111
Showing
3 changed files
with
21 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,17 @@ | ||
export function getViewerOptions($viewer) { | ||
return $viewer.globalContext.getViewers() | ||
.map((v, i) => ({ key: `${i}-${v.plugin.name}`, index: i, name: v.plugin.name, viewer: v })); | ||
return $viewer.globalContext.localContexts | ||
.filter(ctx => ctx.viewer) | ||
.map((ctx, i) => ({ key: ctx.id, index: i, name: ctx.viewer.$plugin.name, context: ctx })); | ||
} | ||
|
||
export function highlightViewer(viewer) { | ||
viewer.$viewer.localContext.el.style.boxSizing = "border-box"; | ||
viewer.$viewer.localContext.el.style.border = "2px solid var(--color-primary)"; | ||
viewer.$viewer.localContext.el.style.opacity = ".85"; | ||
export function highlightViewer(context) { | ||
context.el.style.boxSizing = "border-box"; | ||
context.el.style.border = "2px solid var(--color-primary)"; | ||
context.el.style.opacity = ".85"; | ||
} | ||
|
||
export function unhighlightViewer(viewer) { | ||
viewer.$viewer.localContext.el.style.boxSizing = ""; | ||
viewer.$viewer.localContext.el.style.border = ""; | ||
viewer.$viewer.localContext.el.style.opacity = ""; | ||
export function unhighlightViewer(context) { | ||
context.el.style.boxSizing = ""; | ||
context.el.style.border = ""; | ||
context.el.style.opacity = ""; | ||
} |