UNPKG

itk-viewer-bootstrap-ui

Version:

[![npm version](https://badge.fury.io/js/itk-viewer-bootstrap-ui.svg)](https://badge.fury.io/js/itk-viewer-bootstrap-ui) ![react-bootstrap version](https://img.shields.io/badge/React%20Bootstap-%3E=1.6.1-brightgreen.svg) [![Documentation Status](https://r

18 lines (15 loc) 545 B
function applyComponentVisibility(context, event) { const name = event.data.name if (name !== context.images.selectedName) { return } const actorContext = context.images.actorContext.get(name) const componentSelector = context.images.componentSelector actorContext.componentVisibilities.forEach((visibility, compIdx) => { const element = componentSelector.querySelector( `input[data-component-index="${compIdx}"][type="checkbox"]` ) element.checked = visibility }) } export default applyComponentVisibility