Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #8 using MutationObserver #13

Merged
merged 1 commit into from
Jun 11, 2018
Merged

Fix #8 using MutationObserver #13

merged 1 commit into from
Jun 11, 2018

Conversation

odensc
Copy link
Contributor

@odensc odensc commented Jun 10, 2018

No description provided.

@theCrius
Copy link
Owner

Hey, thanks for that, it works (although I need to find some time to read it properly and understand why mine wasn't) except an error when you're in a page that is not a topic page.

I'll merge it and add a check so that it run only when in a topic's page that is where we've the issue anyway :)

Copy link
Owner

@theCrius theCrius left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Error when not in topic's page, can be solved with a simple IF that encapsulate the logic. Will add myself after the merge.

@theCrius theCrius merged commit 0db7ee6 into theCrius:master Jun 11, 2018
@odensc
Copy link
Contributor Author

odensc commented Jun 11, 2018

The gist of it is that you were listening on document.body, but the comment elements are too deep in the DOM to be picked up by that. If you enabled subtree: true it would have worked, but it would be pretty inefficient - so I listened on the parent element of the comments.

@theCrius
Copy link
Owner

got it, i thought that child (or however that setting was, maybe childrens) was enough to have it iterate through the whole thing.

However yeah, it would have been definitely not optimised, thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants