* Executes the action associated with the button * @param {HTMLElement} $el
($el)
| 353 | * @param {HTMLElement} $el |
| 354 | */ |
| 355 | function click($el) { |
| 356 | if ($el.disabled) return; |
| 357 | |
| 358 | $el.classList.add("click"); |
| 359 | clearTimeout($el.dataset.timeout); |
| 360 | $el.dataset.timeout = setTimeout(() => { |
| 361 | $el.classList.remove("click"); |
| 362 | }, 300); |
| 363 | |
| 364 | if (appSettings.value.vibrateOnTap) { |
| 365 | navigator.vibrate(config.VIBRATION_TIME); |
| 366 | } |
| 367 | |
| 368 | const { action } = $el.dataset; |
| 369 | if (!action) return; |
| 370 | |
| 371 | let { value } = $el.dataset; |
| 372 | |
| 373 | if (!value) { |
| 374 | value = $el.value; |
| 375 | } |
| 376 | |
| 377 | actions(action, value); |
| 378 | } |
| 379 | |
| 380 | function scheduleUpdateQuickToolsState() { |
| 381 | setTimeout(updateQuickToolsState, 0); |