(key, keyOver = null, size = 2)
| 261 | } |
| 262 | |
| 263 | #doSwitch(key, keyOver = null, size = 2) { |
| 264 | const i18nKey = keyOver !== null ? keyOver : key |
| 265 | const node = document.createElement('div') |
| 266 | node.innerHTML = [ |
| 267 | `<i18n-text class="inset-block-header" data-key="user_pref_title_${i18nKey}"></i18n-text>`, |
| 268 | '<div class="row">', |
| 269 | `<i18n-text class="inset-block-blurb-option col-${12-size}" data-key="user_pref_blurb_${i18nKey}"></i18n-text>`, |
| 270 | `<div class="col-${size} form-switch custom-switch">`, |
| 271 | '<input class="form-check-input" type="checkbox" role="switch">', |
| 272 | '</div></div>', |
| 273 | ].join('') |
| 274 | const input = node.querySelector('input') |
| 275 | input.addEventListener('change', () => { this.inputs[key].set(input) }) |
| 276 | this.update.push(() => { this.inputs[key].update(input) }) |
| 277 | return node |
| 278 | } |
| 279 | |
| 280 | #doSpecial(key) { |
| 281 | const node = document.createElement('div') |
no test coverage detected