* Creates a new sidebar app. * @param {string} icon * @param {string} id * @param {string} title * @param {(el:HTMLElement)=>(void|Function)} init * @param {(el:HTMLElement)=>void} onselect
(icon, id, title, init, onselect)
| 32 | * @param {(el:HTMLElement)=>void} onselect |
| 33 | */ |
| 34 | constructor(icon, id, title, init, onselect) { |
| 35 | const emptyFunc = () => {}; |
| 36 | this.#container = <div className="container"></div>; |
| 37 | this.#icon = <Icon icon={icon} id={id} title={title} />; |
| 38 | this.#id = id; |
| 39 | this.#title = title; |
| 40 | this.#init = init || emptyFunc; |
| 41 | this.#onselect = onselect || emptyFunc; |
| 42 | const cleanup = this.#init(this.#container); |
| 43 | if (typeof cleanup === "function") { |
| 44 | this.#cleanup = cleanup; |
| 45 | } |
| 46 | } |
| 47 | |
| 48 | /** |
| 49 | * Installs the app in the sidebar. |
nothing calls this directly
no outgoing calls
no test coverage detected