mirror of
https://github.com/iSharkFly-Docs/opensearch-docs-cn
synced 2025-03-09 14:38:01 +00:00
* Adds back to top button Signed-off-by: Fanit Kolchina <kolchfa@amazon.com> * Makes sidebar sticky Signed-off-by: Fanit Kolchina <kolchfa@amazon.com> * Gives more real estate to the main pane Signed-off-by: Fanit Kolchina <kolchfa@amazon.com> * Adds copy button Signed-off-by: Fanit Kolchina <kolchfa@amazon.com> * Adds copy button to code snippets Signed-off-by: Fanit Kolchina <kolchfa@amazon.com> * Adds copy as curl Signed-off-by: Fanit Kolchina <kolchfa@amazon.com> * Moved copy buttons to the bottom right of snippets Signed-off-by: Fanit Kolchina <kolchfa@amazon.com> * Moved edit page footer to the bottom of the page Signed-off-by: Fanit Kolchina <kolchfa@amazon.com> * Implemented scrolling to the active link in navbar on reload Signed-off-by: Fanit Kolchina <kolchfa@amazon.com> * Adds feedback buttons Signed-off-by: Fanit Kolchina <kolchfa@amazon.com> Signed-off-by: Fanit Kolchina <kolchfa@amazon.com>
13 lines
346 B
JavaScript
13 lines
346 B
JavaScript
let siteNav = document.querySelector('.site-nav');
|
|
|
|
document.addEventListener('DOMContentLoaded', () => {
|
|
const scroll = localStorage.getItem('scroll');
|
|
if (scroll !== null) {
|
|
siteNav.scrollTop = parseInt(scroll);
|
|
}
|
|
});
|
|
|
|
window.addEventListener('beforeunload', () => {
|
|
localStorage.setItem('scroll', siteNav.scrollTop);
|
|
});
|