From bb6088b8493d9f59f45e80753d5bd0f0eae7e21c Mon Sep 17 00:00:00 2001
From: Shane <6071159+smashedr@users.noreply.github.com>
Date: Fri, 25 Oct 2024 22:49:46 -0700
Subject: [PATCH] Cleanup resetInput
---
src/html/options.html | 4 ++--
src/js/options.js | 8 ++------
2 files changed, 4 insertions(+), 8 deletions(-)
diff --git a/src/html/options.html b/src/html/options.html
index fe86c05..94500c0 100644
--- a/src/html/options.html
+++ b/src/html/options.html
@@ -66,8 +66,8 @@
Link Extractor
+ data-bs-title="Reset Regex Flags to Default Value." data-bs-toggle="tooltip"
+ data-value="ig" data-reset-input="flags">
diff --git a/src/js/options.js b/src/js/options.js
index 9dd709a..be7a915 100644
--- a/src/js/options.js
+++ b/src/js/options.js
@@ -210,13 +210,9 @@ async function resetInput(event) {
const target = event.currentTarget
console.debug('target:', target)
event.preventDefault()
- const id = target.dataset.resetInput
- console.debug('id:', id)
- const value = target.dataset.value
- console.debug('value:', value)
- const input = document.getElementById(id)
+ const input = document.getElementById(target.dataset.resetInput)
console.debug('input:', input)
- input.value = value
+ input.value = target.dataset.value
input.classList.remove('is-invalid')
input.focus()
const changeEvent = new Event('change')