JS runs multiple times creating performance issue

Created on 28 November 2021, about 3 years ago
Updated 6 September 2023, over 1 year ago

Problem/Motivation

When loading a page where this buttons are added, the popup window is added multiple times with the click event listeners.

Steps to reproduce

Add this to a content.
Make sure you have multiple ajax loads (probably).
You will see in the DOM multiple <ul class="atcb-list"> items. And on the <em class="placeholder">Add to Calendar</em> multiple click event listener.

Proposed resolution

Restrict to add only once. Both the click event listener and the popup.

Remaining tasks

Patch.

User interface changes

-

API changes

-

Data model changes

-

🐛 Bug report
Status

Needs work

Version

3.2

Component

Code

Created by

🇧🇪Belgium golddragon007

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024