Merge pull request #328 from pastalian/master

Fix toc toggle bug
This commit is contained in:
zzossig 2020-10-21 04:51:09 +09:00 committed by GitHub
commit d1f7c34911
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 5 deletions

View File

@ -11,7 +11,7 @@ var fadeOut = function(node, duration) {
requestAnimationFrame(tick);
} else {
node.style.opacity = '';
node.style.display = 'none';
node.classList.add('hide');
}
});
}
@ -19,10 +19,8 @@ var fadeOut = function(node, duration) {
var fadeIn = function (node, duration) {
if (getComputedStyle(node).display !== 'none') return;
if (node.style.display === 'none') {
node.style.display = '';
} else {
node.style.display = 'block';
if (node.classList.contains('hide')) {
node.classList.remove('hide');
}
node.style.opacity = 0;