mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2025-04-25 14:28:59 +08:00
fixed a bug where copy animation remained
This commit is contained in:
parent
d08d730163
commit
786809d5ca
22
script.js
22
script.js
@ -213,6 +213,16 @@ function uiElementInSight(el) {
|
|||||||
return isOnScreen;
|
return isOnScreen;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function uiCopyElementAnimate(el) {
|
||||||
|
el.classList.remove('animate');
|
||||||
|
setTimeout(() => {
|
||||||
|
el.classList.add('animate');
|
||||||
|
}, 0);
|
||||||
|
setTimeout(() => {
|
||||||
|
el.classList.remove('animate');
|
||||||
|
}, 1100);
|
||||||
|
}
|
||||||
|
|
||||||
function uiCopyElementText(el) {
|
function uiCopyElementText(el) {
|
||||||
var text = el.innerText;
|
var text = el.innerText;
|
||||||
if (text.startsWith('"')) {
|
if (text.startsWith('"')) {
|
||||||
@ -220,11 +230,7 @@ function uiCopyElementText(el) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
navigator.clipboard.writeText(text);
|
navigator.clipboard.writeText(text);
|
||||||
|
uiCopyElementAnimate(el);
|
||||||
el.classList.remove('animate');
|
|
||||||
setTimeout(() => {
|
|
||||||
el.classList.add('animate');
|
|
||||||
}, 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function uiCopyRawText(elid) {
|
function uiCopyRawText(elid) {
|
||||||
@ -266,10 +272,6 @@ function uiCopyPngInfo(el, mode) {
|
|||||||
|
|
||||||
if (text != null) {
|
if (text != null) {
|
||||||
navigator.clipboard.writeText(text);
|
navigator.clipboard.writeText(text);
|
||||||
|
uiCopyElementAnimate(el);
|
||||||
el.classList.remove('animate');
|
|
||||||
setTimeout(() => {
|
|
||||||
el.classList.add('animate');
|
|
||||||
}, 0);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user