Skip to content

Commit

Permalink
Cleanup resetInput
Browse files Browse the repository at this point in the history
  • Loading branch information
smashedr committed Oct 26, 2024
1 parent 563c177 commit bb6088b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/html/options.html
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ <h1>Link Extractor</h1>
<div class="input-group">
<input id="flags" placeholder="Lazy Tab Title" type="text" class="form-control" aria-describedby="flagsHelp">
<span id="reset-regex" class="input-group-text text-warning-emphasis" role="button"
data-target="flags" data-value="ig" data-reset-input="flags"
data-bs-title="Reset Regex Flags to Default Value." data-bs-toggle="tooltip">
data-bs-title="Reset Regex Flags to Default Value." data-bs-toggle="tooltip"
data-value="ig" data-reset-input="flags">
<i class="fa-solid fa-rotate-left"></i>
</span>
<!-- <span class="input-group-text">-->
Expand Down
8 changes: 2 additions & 6 deletions src/js/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down

0 comments on commit bb6088b

Please sign in to comment.