-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Trigger events once #38385
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
Trigger events once #38385
Conversation
|
Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes. |
JammingBen
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't know that namespacing jQuery-events is a thing, cool stuff 👍
|
Looks good. Fixes #37085 |
b44a705 to
988c7cf
Compare
|
Kudos, SonarCloud Quality Gate passed! |
|
This patch was provided to a customer because of potential query optimization in https://github.com/owncloud/enterprise/issues/4374 The customer now reports that they discovered that they had to revert the patch, because the page "Shared with you" would no longer show all shares. |
Description
Prevent the registration of the same event listener several times, which causes the same action (from the duplicated listeners) to be performed multiple times.
Primary problem is with the "urlChanged" event, which causes an ajax request to be thrown. This means that, without this fix, the ajax requests performed were increasing along with the increasing event listeners being registered for that event.
The other events don't seem to be too critical since the attached action is pretty light.
Related Issue
Helps with https://github.com/owncloud/enterprise/issues/4374
Motivation and Context
No need to register the same event listener twice
How Has This Been Tested?
Mostly tested going back and forth between the "all files" and "shared with you" sections in the files view, as well as checking there is no apparent problem with the scrolling in those sections.
Event registration has been checked with the firefox dev tools, ensuring there is no increasing event associated with the target web element. There could be multiple listeners for the same event, but it's expected to be for different purposes (not duplicated)
Screenshots (if appropriate):
Types of changes
Checklist: