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 JS events from legacy controllers are bound multiple times #2688

Merged
merged 4 commits into from
Mar 12, 2025

Conversation

ramonski
Copy link
Contributor

@ramonski ramonski commented Mar 8, 2025

Description of the issue/feature this PR addresses

This PR fixes an issue that arises if the Service Info Icon is clicked in a Sample view (and probably elsewhere, where an overlay was used)

Current behavior before PR

Clicking on the service info icons one by one duplicates the requests to the server.

E.g. first click:

second click on another service:

third click (and so on...):

If this is done long enogh, the server becoms unresponsive.

Desired behavior after PR is merged

Event handlers coming from legacy controllers are bound only once on document load.

--
I confirm I have tested this PR thoroughly and coded it according to PEP8
and Plone's Python styleguide standards.

@ramonski ramonski changed the title Fix JS controllers are initialized multiple times Fix JS event from legacy controllers are bound multiple times Mar 8, 2025
@ramonski ramonski changed the title Fix JS event from legacy controllers are bound multiple times Fix JS events from legacy controllers are bound multiple times Mar 8, 2025
@ramonski ramonski requested a review from xispa March 8, 2025 10:01
Copy link
Member

@xispa xispa left a comment

Choose a reason for hiding this comment

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

Thanks!

@xispa xispa merged commit 4d32415 into 2.x Mar 12, 2025
2 checks passed
@xispa xispa deleted the fix-multi-event-handler-registrations branch March 12, 2025 08:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

2 participants