mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2026-02-01 21:32:01 -08:00
fixed a bug where copy animation remained
This commit is contained in:
parent
d08d730163
commit
786809d5ca
1 changed files with 12 additions and 10 deletions
22
script.js
22
script.js
|
|
@ -213,6 +213,16 @@ function uiElementInSight(el) {
|
|||
return isOnScreen;
|
||||
}
|
||||
|
||||
function uiCopyElementAnimate(el) {
|
||||
el.classList.remove('animate');
|
||||
setTimeout(() => {
|
||||
el.classList.add('animate');
|
||||
}, 0);
|
||||
setTimeout(() => {
|
||||
el.classList.remove('animate');
|
||||
}, 1100);
|
||||
}
|
||||
|
||||
function uiCopyElementText(el) {
|
||||
var text = el.innerText;
|
||||
if (text.startsWith('"')) {
|
||||
|
|
@ -220,11 +230,7 @@ function uiCopyElementText(el) {
|
|||
}
|
||||
|
||||
navigator.clipboard.writeText(text);
|
||||
|
||||
el.classList.remove('animate');
|
||||
setTimeout(() => {
|
||||
el.classList.add('animate');
|
||||
}, 0);
|
||||
uiCopyElementAnimate(el);
|
||||
}
|
||||
|
||||
function uiCopyRawText(elid) {
|
||||
|
|
@ -266,10 +272,6 @@ function uiCopyPngInfo(el, mode) {
|
|||
|
||||
if (text != null) {
|
||||
navigator.clipboard.writeText(text);
|
||||
|
||||
el.classList.remove('animate');
|
||||
setTimeout(() => {
|
||||
el.classList.add('animate');
|
||||
}, 0);
|
||||
uiCopyElementAnimate(el);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue