(buttonInfo: Options | string, htmlarea: HTMLElement)
| 97 | const button = document.createElement(head ? "span" : "button"); |
| 98 | this.buttonMap.set(inner, button); |
| 99 | button.classList.add( |
| 100 | ...[head ? "headSetting" : "SettingsButton", contained ? "settingsIndent" : ""].filter( |
| 101 | (_) => _, |
| 102 | ), |
| 103 | ); |
| 104 | button.textContent = name; |
| 105 | if (!head) |
| 106 | button.onclick = (_) => { |
| 107 | this.generateHTMLArea(inner, optionsArea); |
| 108 | optionsArea.classList.remove("mobileHidden"); |
| 109 | if (this.warndiv) { |
| 110 | this.warndiv.remove(); |
| 111 | } |
| 112 | }; |
| 113 | if (color === buttonColor.RED) { |
| 114 | button.classList.add("settingRed"); |
| 115 | } |
| 116 | return button; |
| 117 | } |
| 118 | generateButtons(optionsArea: HTMLElement) { |
| 119 | const buttonTable = document.createElement("div"); |
| 120 | buttonTable.classList.add("settingbuttons"); |
| 121 | if (this.top) { |
| 122 | buttonTable.classList.add("flexltr"); |
| 123 | } |
| 124 | for (const button of this.buttons) { |
| 125 | buttonTable.append(this.makeButtonHTML(button, optionsArea)); |
| 126 | } |
no test coverage detected