()
| 734 | } |
| 735 | |
| 736 | private syncModelToBrush() { |
| 737 | // Move and redraw the brush selectors, preventing move events to be triggered |
| 738 | this.ignoreBrushEvents = true; |
| 739 | try { |
| 740 | const selected = this.model.get('_selected'); |
| 741 | |
| 742 | this.brushes.forEach((brush, index) => { |
| 743 | const brushSelected = selected[this.get_label(index)]; |
| 744 | |
| 745 | if (brushSelected) { |
| 746 | const range = brushSelected |
| 747 | .map((v) => this.scale.scale(v)) |
| 748 | .sort(sort); |
| 749 | |
| 750 | this.update_text(index, range); |
| 751 | brush.move(this.brush_g[index], range); |
| 752 | } else { |
| 753 | this.update_text(index, null); |
| 754 | brush.move(this.brush_g[index], null); |
| 755 | } |
| 756 | |
| 757 | this.brush_g[index].call(brush); |
| 758 | this.reset_handler(this.brush_g[index]); |
| 759 | }); |
| 760 | } finally { |
| 761 | this.ignoreBrushEvents = false; |
| 762 | } |
| 763 | } |
| 764 | |
| 765 | remove() { |
| 766 | this.model.off('change:names', null, this); |
no test coverage detected