From db581ee23d2e39822b76038ee9277f828380bd0d Mon Sep 17 00:00:00 2001 From: igoradamenko Date: Sat, 28 Apr 2018 22:14:30 +0300 Subject: [PATCH] fix url hash check --- web/TODO.md | 7 ------- web/app/components/root/root.jsx | 4 ++-- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/web/TODO.md b/web/TODO.md index 750cca66..15fcc0a1 100644 --- a/web/TODO.md +++ b/web/TODO.md @@ -1,10 +1,3 @@ -major fixes: - -- comment scroller: - we can't get access to window.parent.location, - so we need to use postMessage for pushing location.hash - into the iframe - major features: - improve design diff --git a/web/app/components/root/root.jsx b/web/app/components/root/root.jsx index 1c5c4a31..6650e0d5 100644 --- a/web/app/components/root/root.jsx +++ b/web/app/components/root/root.jsx @@ -59,8 +59,8 @@ export default class Root extends Component { } checkUrlHash() { - if (window.parent.location.hash.indexOf('#remark__comment-') === 0) { - const comment = document.querySelector(window.parent.location.hash); + if (window.location.hash.indexOf('#remark__comment-') === 0) { + const comment = document.querySelector(window.location.hash); if (comment) { setTimeout(() => {