(section_name, option_index)
| 806 | return this.options && section_name in this.options ? this.options[section_name] : section.default |
| 807 | } |
| 808 | selectOption(section_name, option_index) { |
| 809 | var section = IMAGE_EDITOR_SECTIONS.find((s) => s.name == section_name) |
| 810 | var value = section.options[option_index] |
| 811 | this.options[section_name] = value == "custom" ? section.getCustom(this) : value |
| 812 | |
| 813 | this.optionElements[section_name].forEach((element) => element.classList.remove("active")) |
| 814 | this.optionElements[section_name][option_index].classList.add("active") |
| 815 | |
| 816 | // change the editor |
| 817 | this.setBrush() |
| 818 | if (section.name == "tool") { |
| 819 | this.loadTool() |
| 820 | } |
| 821 | } |
| 822 | } |
| 823 | |
| 824 | const imageEditor = new ImageEditor(document.getElementById("image-editor")) |
no test coverage detected