toggleOption()

in src/components/base/form/form_checkbox_tree/models/tree.js [152:163]


  toggleOption({ value }, checked, propagateToParent = true) {
    const node = this.getNode(value);
    Tree.toggleNodeState(node, checked);

    if (node.isChild && propagateToParent) {
      this.toggleParentOption(node.parent);
    }

    if (node.isParent) {
      node.children.forEach((child) => this.toggleOption(child, checked, false));
    }
  }