mirror of
https://github.com/easydiffusion/easydiffusion.git
synced 2025-06-13 13:27:55 +02:00
Visual feedback for the copy and paste icons
This commit is contained in:
parent
1c3d5cd851
commit
e561e4de0b
@ -887,3 +887,7 @@ input::file-selector-button {
|
|||||||
margin-bottom: 15px;
|
margin-bottom: 15px;
|
||||||
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.15), 0 6px 20px 0 rgba(0, 0, 0, 0.15);
|
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.15), 0 6px 20px 0 rgba(0, 0, 0, 0.15);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
i.active {
|
||||||
|
background: var(--accent-color);
|
||||||
|
}
|
||||||
|
@ -430,6 +430,10 @@ function checkWriteToClipboardPermission (result) {
|
|||||||
copyIcon.innerHTML = `<span class="simple-tooltip right">Copy Image Settings</span>`
|
copyIcon.innerHTML = `<span class="simple-tooltip right">Copy Image Settings</span>`
|
||||||
copyIcon.addEventListener('click', (event) => {
|
copyIcon.addEventListener('click', (event) => {
|
||||||
event.stopPropagation()
|
event.stopPropagation()
|
||||||
|
// Add css class 'active'
|
||||||
|
copyIcon.classList.add('active')
|
||||||
|
// In 1000 ms remove the 'active' class
|
||||||
|
asyncDelay(1000).then(() => copyIcon.classList.remove('active'))
|
||||||
const uiState = readUI()
|
const uiState = readUI()
|
||||||
TASK_REQ_NO_EXPORT.forEach((key) => delete uiState.reqBody[key])
|
TASK_REQ_NO_EXPORT.forEach((key) => delete uiState.reqBody[key])
|
||||||
if (uiState.reqBody.init_image && !IMAGE_REGEX.test(uiState.reqBody.init_image)) {
|
if (uiState.reqBody.init_image && !IMAGE_REGEX.test(uiState.reqBody.init_image)) {
|
||||||
@ -446,6 +450,10 @@ function checkWriteToClipboardPermission (result) {
|
|||||||
pasteIcon.innerHTML = `<span class="simple-tooltip right">Paste Image Settings</span>`
|
pasteIcon.innerHTML = `<span class="simple-tooltip right">Paste Image Settings</span>`
|
||||||
pasteIcon.addEventListener('click', (event) => {
|
pasteIcon.addEventListener('click', (event) => {
|
||||||
event.stopPropagation()
|
event.stopPropagation()
|
||||||
|
// Add css class 'active'
|
||||||
|
pasteIcon.classList.add('active')
|
||||||
|
// In 1000 ms remove the 'active' class
|
||||||
|
asyncDelay(1000).then(() => pasteIcon.classList.remove('active'))
|
||||||
pasteFromClipboard()
|
pasteFromClipboard()
|
||||||
})
|
})
|
||||||
resetSettings.parentNode.insertBefore(pasteIcon, resetSettings)
|
resetSettings.parentNode.insertBefore(pasteIcon, resetSettings)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user