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

Mouse event handlers called one extra time for every new comment until page reload #214

Open
orblivion opened this issue Dec 19, 2021 · 0 comments

Comments

@orblivion
Copy link
Contributor

I noticed this while debugging something. I'm on etherpad 1.8.16, ep_comments_page 0.1.83.

In static/js/index.js, put a console.log or alert inside any or all of the following handlers (and perhaps others, for all I know):

  • this.container.on('mouseover', '.sidebar-comment', (e) => {...
  • ...on('mouseout', '.sidebar-comment', (e) => {...
  • this.padInner.contents().on('mouseover', '.comment', function (e) {...
  • this.padInner.contents().on('click', '.comment', function (e) {...
  • this.padInner.contents().on('mouseleave', '.comment', (e) => {...

Open a blank file. Add a comment. Trigger the events. You'll find that the handlers are fired a single time, as expected.

Now, try adding a new comment somewhere in the file. Trigger the events again. You'll find that the handlers are fired twice.

Add another comment. Trigger the events, the handlers are fired three times.

Reload the page.

Trigger the events. You'll find that the handlers are again fired a single time.

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

No branches or pull requests

1 participant