Merge pull request #2101 from zqianem/gh-443/menu-border
Avoid menu border flash during page navigation
This commit is contained in:
commit
a51f8a6b8e
|
@ -676,13 +676,14 @@ function playground_text(playground, hidden = true) {
|
||||||
}, { passive: true });
|
}, { passive: true });
|
||||||
})();
|
})();
|
||||||
(function controllBorder() {
|
(function controllBorder() {
|
||||||
menu.classList.remove('bordered');
|
function updateBorder() {
|
||||||
document.addEventListener('scroll', function () {
|
|
||||||
if (menu.offsetTop === 0) {
|
if (menu.offsetTop === 0) {
|
||||||
menu.classList.remove('bordered');
|
menu.classList.remove('bordered');
|
||||||
} else {
|
} else {
|
||||||
menu.classList.add('bordered');
|
menu.classList.add('bordered');
|
||||||
}
|
}
|
||||||
}, { passive: true });
|
}
|
||||||
|
updateBorder();
|
||||||
|
document.addEventListener('scroll', updateBorder, { passive: true });
|
||||||
})();
|
})();
|
||||||
})();
|
})();
|
||||||
|
|
|
@ -115,7 +115,7 @@
|
||||||
<div class="page">
|
<div class="page">
|
||||||
{{> header}}
|
{{> header}}
|
||||||
<div id="menu-bar-hover-placeholder"></div>
|
<div id="menu-bar-hover-placeholder"></div>
|
||||||
<div id="menu-bar" class="menu-bar sticky bordered">
|
<div id="menu-bar" class="menu-bar sticky">
|
||||||
<div class="left-buttons">
|
<div class="left-buttons">
|
||||||
<button id="sidebar-toggle" class="icon-button" type="button" title="Toggle Table of Contents" aria-label="Toggle Table of Contents" aria-controls="sidebar">
|
<button id="sidebar-toggle" class="icon-button" type="button" title="Toggle Table of Contents" aria-label="Toggle Table of Contents" aria-controls="sidebar">
|
||||||
<i class="fa fa-bars"></i>
|
<i class="fa fa-bars"></i>
|
||||||
|
|
Loading…
Reference in New Issue