Fix revealing spoilers when animation is disabled
This commit is contained in:
parent
acf06c24fd
commit
cca5e6f0e2
@ -1060,15 +1060,24 @@ export default class ChatBubbles {
|
|||||||
|
|
||||||
const duration = 400 / 2;
|
const duration = 400 / 2;
|
||||||
const showDuration = 5000;
|
const showDuration = 5000;
|
||||||
const useRafs = !isVisible ? 1 : 0;
|
const useRafs = !isVisible ? 2 : 0;
|
||||||
if(useRafs) {
|
if(useRafs) {
|
||||||
messageDiv.classList.add('will-change');
|
messageDiv.classList.add('will-change');
|
||||||
}
|
}
|
||||||
|
|
||||||
SetTransition(messageDiv, className, true, duration + showDuration, () => {
|
const spoilerTimeout = messageDiv.dataset.spoilerTimeout;
|
||||||
SetTransition(messageDiv, className, false, duration, () => {
|
if(spoilerTimeout !== null) {
|
||||||
messageDiv.classList.remove('will-change');
|
clearTimeout(+spoilerTimeout);
|
||||||
});
|
delete messageDiv.dataset.spoilerTimeout;
|
||||||
|
}
|
||||||
|
|
||||||
|
SetTransition(messageDiv, className, true, duration, () => {
|
||||||
|
messageDiv.dataset.spoilerTimeout = '' + window.setTimeout(() => {
|
||||||
|
SetTransition(messageDiv, className, false, duration, () => {
|
||||||
|
messageDiv.classList.remove('will-change');
|
||||||
|
delete messageDiv.dataset.spoilerTimeout;
|
||||||
|
});
|
||||||
|
}, showDuration);
|
||||||
}, useRafs);
|
}, useRafs);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
@ -63,4 +63,10 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&:not(.is-spoiler-visible) {
|
||||||
|
.spoiler {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user