Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #364 from nusjzx/310-autoscroll-after-page-loaded
Autoscroll after the whole page is loaded If the user navigates to 'index.html#some-heading', by default, the browser will automatically scroll to the correct HTML header with 'some-heading' as its ID. However, there is a race condition between the scrolling by the browser, and the loading of components by Vue. Vue might take a long time to load the components, so if the browser scrolls too early, then when the components are fully loaded, the page appearance would have changed, and the position is no longer accurate. Let's force the browser to scroll again after Vue finishes loading, by hooking Vue's 'mounted' lifecycle, and manually scrolling to the anchor using jQuery inside the hook.
- Loading branch information