FIX: Use chrome's `scrollRestoration` to fix scrolling uses with history

This commit is contained in:
Robin Ward 2016-02-11 13:14:43 -05:00
parent e3cc04f315
commit 786f6ff8b0
1 changed files with 6 additions and 1 deletions

View File

@ -31,7 +31,12 @@ const DiscourseLocation = Ember.Object.extend({
@method initState
*/
initState() {
set(this, 'history', get(this, 'history') || window.history);
const history = get(this, 'history') || window.history;
if (history && history.scrollRestoration) {
history.scrollRestoration = "manual";
}
set(this, 'history', history);
let url = this.formatURL(this.getURL());
const loc = get(this, 'location');