add hashchange listener

This commit is contained in:
igoradamenko
2018-05-26 19:12:13 +03:00
parent 4a39daa552
commit 4de3c3c50f
+2 -1
View File
@@ -70,6 +70,7 @@ export default class Root extends Component {
});
setTimeout(this.checkUrlHash);
window.addEventListener('hashchange', this.checkUrlHash);
});
}
@@ -80,7 +81,7 @@ export default class Root extends Component {
if (comment) {
setTimeout(() => {
comment.scrollIntoView();
window.scrollTo(window.scrollX, 0); // sometimes smth goes wrong and iframe scrolls; we return it here
window.scrollTo(window.scrollX, 0); // sometimes smth goes wrong and iframe scrolls; we return it back
}, 500);
}
}