fix(ui): Simplify sidebar initialization logic
Replace redundant conditional blocks with single if-else statement and move resize listener outside viewport check. Changes width threshold from `>` to `>=` for consistency with standard breakpoint behavior. Fixes #22930
This commit is contained in:
parent
58ac88bc51
commit
b6cc7d811f
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -76,22 +76,17 @@ class SideNav {
|
|||
toggler.addEventListener('click', event => this.onMobileToggle(event));
|
||||
}
|
||||
|
||||
if (window.innerWidth > 1200) {
|
||||
if (window.innerWidth >= 1200) {
|
||||
if (this.state.get('pinned')) {
|
||||
this.pin();
|
||||
}
|
||||
|
||||
if (!this.state.get('pinned')) {
|
||||
} else {
|
||||
this.unpin();
|
||||
}
|
||||
window.addEventListener('resize', () => this.onResize());
|
||||
}
|
||||
|
||||
if (window.innerWidth < 1200) {
|
||||
} else {
|
||||
this.bodyRemove('hide');
|
||||
this.bodyAdd('hidden');
|
||||
window.addEventListener('resize', () => this.onResize());
|
||||
}
|
||||
window.addEventListener('resize', () => this.onResize());
|
||||
|
||||
this.base.addEventListener('mouseenter', () => this.onEnter());
|
||||
this.base.addEventListener('mouseleave', () => this.onLeave());
|
||||
|
|
|
|||
Loading…
Reference in New Issue