ok, let's try to fix scroll to parent again
This commit is contained in:
@@ -185,11 +185,21 @@ export default class Comment extends Component {
|
||||
|
||||
scrollToParent(e) {
|
||||
const { data: { pid } } = this.props;
|
||||
const hash = `#${COMMENT_NODE_CLASSNAME_PREFIX}${pid}`;
|
||||
|
||||
e.preventDefault();
|
||||
|
||||
// reset old hash
|
||||
postMessage({ hash: '' });
|
||||
postMessage({ hash: `#${COMMENT_NODE_CLASSNAME_PREFIX}${pid}` });
|
||||
|
||||
// set new hash
|
||||
postMessage({ hash });
|
||||
|
||||
// try to scroll into view
|
||||
const parentCommentNode = document.querySelector(hash);
|
||||
if (parentCommentNode) {
|
||||
parentCommentNode.scrollIntoView();
|
||||
}
|
||||
}
|
||||
|
||||
render(props, { guest, isUserIdVisible, userBlocked, pinned, score, scoreIncreased, scoreDecreased, deleted, isInputVisible }) {
|
||||
|
||||
+3
-3
@@ -24,13 +24,13 @@
|
||||
|
||||
<script>
|
||||
var remark_config = {
|
||||
site_id: 'radiot',
|
||||
url: 'https://radio-t.com/p/2017/12/16/podcast-576/',
|
||||
ё site_id: 'remark',
|
||||
url: 'https://remark42.com/demo/',
|
||||
};
|
||||
|
||||
(function() {
|
||||
var d = document, s = d.createElement('script');
|
||||
var baseurl = '';
|
||||
var baseurl = 'https://demo.remark42.com/';
|
||||
s.src = baseurl + '/web/embed.js';
|
||||
s.type = 'text/javascript';
|
||||
(d.head || d.body).appendChild(s);
|
||||
|
||||
Reference in New Issue
Block a user