Skip to content

Commit

Permalink
Add a "Cut" button to in flight items
Browse files Browse the repository at this point in the history
  • Loading branch information
hkolbeck committed Jul 26, 2023
1 parent aaf4d55 commit 04d38e1
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/in-flight.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ function buildInFlightItem(idx, chunk) {
nameInput.type = "text"
nameInput.placeholder = getLocalized("untitledName")
nameInput.ariaLabel = getLocalized("nameLabel")
nameInput.onchange = () => inFlight[idx].name = nameInput.value
nameInput.onchange = () => MyAltTextOrg.inFlight[idx].name = nameInput.value
outer.appendChild(nameInput)

const charCounter = document.createElement("div")
Expand Down Expand Up @@ -132,6 +132,17 @@ function buildInFlightItem(idx, chunk) {
copyBtn.onclick = () => duplicateChunk(idx)
controls.appendChild(copyBtn)

const cutButton = document.createElement("button")
cutButton.classList.add("page-button", "emoji-button")
cutButton.innerText = "✂️"
cutButton.title = "Cut"
cutButton.ariaLabel = "Cut text"
cutButton.onclick = async () => {
await navigator.clipboard.writeText(textArea.value)
removeInFlight(idx)
}
controls.appendChild(cutButton)

const saveBtn = document.createElement("button")
saveBtn.classList.add("page-button", "emoji-button")
saveBtn.innerText = "💾"
Expand Down

0 comments on commit 04d38e1

Please sign in to comment.