MCPcopy Index your code
hub / github.com/easydiffusion/easydiffusion / selectOption

Method selectOption

ui/media/js/image-editor.js:808–821  ·  view source on GitHub ↗
(section_name, option_index)

Source from the content-addressed store, hash-verified

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
824const imageEditor = new ImageEditor(document.getElementById("image-editor"))

Callers 2

constructorMethod · 0.95
keyHandlerMethod · 0.95

Calls 3

setBrushMethod · 0.95
loadToolMethod · 0.95
addMethod · 0.45

Tested by

no test coverage detected