Last modified by XWikiGuest on 2026/03/11 21:04

From version 3.1
edited by XWikiGuest
on 2026/03/11 20:17
Change comment: There is no comment for this version
To version 4.1
edited by XWikiGuest
on 2026/03/11 20:22
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -155,15 +155,20 @@
155 155   container.innerHTML = html;
156 156   document.getElementById('ldsf-status').textContent = total + ' bookmarks, ' + archiveCount + ' met archief';
157 157  
158 - // Event delegation for archive buttons
159 - container.addEventListener('click', function(e) {
160 - var btn = e.target.closest('.sf-btn');
161 - if (!btn) return;
162 - var idx = btn.getAttribute('data-idx');
163 - if (idx !== null && archiveMap[idx]) {
164 - ldsfShowArchive(archiveMap[idx], btn);
165 - }
166 - });
158 + // Bind click handlers directly to buttons
159 + var buttons = container.querySelectorAll('.sf-btn');
160 + for (var b = 0; b < buttons.length; b++) {
161 + (function(btn) {
162 + var idx = btn.getAttribute('data-idx');
163 + btn.addEventListener('click', function(ev) {
164 + ev.preventDefault();
165 + ev.stopPropagation();
166 + if (archiveMap[idx]) {
167 + ldsfShowArchive(archiveMap[idx], btn);
168 + }
169 + });
170 + })(buttons[b]);
171 + }
167 167   })
168 168   .catch(function(err) {
169 169   document.getElementById('ldsf-status').textContent = 'Fout: ' + err.message;