Skip to content

Instantly share code, notes, and snippets.

@sc1f
Created September 8, 2021 12:34
Show Gist options
  • Save sc1f/84077fabe54bd00bbfa8bce69daae780 to your computer and use it in GitHub Desktop.
Save sc1f/84077fabe54bd00bbfa8bce69daae780 to your computer and use it in GitHub Desktop.
Force all PerspectiveWidget configs to hide/show
%%javascript
// Select all PerspectiveWidget elements that are currently being displayed
const viewers = document.querySelectorAll("perspective-viewer");
// Toggle the config for each one. This can be made more complex to show and hide specific configs for specific viewers, etc.
for (const viewer of viewers) viewer.toggleConfig()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment