mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-09-07 10:22:59 +00:00
Add sidebar animation when collapsing
This commit is contained in:
7
docs/_static/sidebar.js
vendored
7
docs/_static/sidebar.js
vendored
@ -64,19 +64,17 @@ class Sidebar {
|
||||
collapseSection(icon) {
|
||||
icon.classList.remove('expanded');
|
||||
icon.classList.add('collapsed');
|
||||
icon.innerText = 'chevron_right';
|
||||
let children = icon.nextElementSibling.nextElementSibling;
|
||||
// <arrow><heading>
|
||||
// --> <square><children>
|
||||
children.style.display = "none";
|
||||
setTimeout(() => children.style.display = "none", 75)
|
||||
}
|
||||
|
||||
expandSection(icon) {
|
||||
icon.classList.remove('collapse');
|
||||
icon.classList.add('expanded');
|
||||
icon.innerText = 'expand_more';
|
||||
let children = icon.nextElementSibling.nextElementSibling;
|
||||
children.style.display = "block";
|
||||
setTimeout(() => children.style.display = "block", 75)
|
||||
}
|
||||
|
||||
setActiveLink(section) {
|
||||
@ -127,4 +125,3 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
sidebar.resize();
|
||||
});
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user