nodebb-plugin-calendar-onekite 12.0.25 → 12.0.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nodebb-plugin-calendar-onekite",
3
- "version": "12.0.25",
3
+ "version": "12.0.26",
4
4
  "description": "FullCalendar-based equipment reservation workflow with admin approval & HelloAsso payment for NodeBB",
5
5
  "main": "library.js",
6
6
  "license": "MIT",
package/plugin.json CHANGED
@@ -39,5 +39,5 @@
39
39
  "acpScripts": [
40
40
  "public/admin.js"
41
41
  ],
42
- "version": "1.3.2"
42
+ "version": "1.3.5"
43
43
  }
package/public/admin.js CHANGED
@@ -233,8 +233,9 @@ define('admin/plugins/calendar-onekite', ['alerts', 'bootbox'], function (alerts
233
233
  <div class="text-muted" style="font-size: 12px;">Période: ${escapeHtml(new Date(parseInt(r.start, 10)).toLocaleDateString('fr-FR'))} → ${escapeHtml(new Date(parseInt(r.end, 10)).toLocaleDateString('fr-FR'))}</div>
234
234
  </div>
235
235
  <div class="d-flex gap-2">
236
- <button class="btn btn-outline-danger btn-sm" data-action="refuse" data-rid="${escapeHtml(String(r.rid || ''))}">Refuser</button>
237
- <button class="btn btn-success btn-sm" data-action="approve" data-rid="${escapeHtml(String(r.rid || ''))}">Valider</button>
236
+ <!-- IMPORTANT: type="button" to avoid submitting the settings form and resetting ACP tabs -->
237
+ <button type="button" class="btn btn-outline-danger btn-sm" data-action="refuse" data-rid="${escapeHtml(String(r.rid || ''))}">Refuser</button>
238
+ <button type="button" class="btn btn-success btn-sm" data-action="approve" data-rid="${escapeHtml(String(r.rid || ''))}">Valider</button>
238
239
  </div>
239
240
  </div>
240
241
  `;
@@ -432,6 +433,12 @@ define('admin/plugins/calendar-onekite', ['alerts', 'bootbox'], function (alerts
432
433
  pendingWrap.addEventListener('click', async (ev) => {
433
434
  const btn = ev.target && ev.target.closest('button[data-action]');
434
435
  if (!btn) return;
436
+ // Prevent the settings form from submitting (default <button> behavior)
437
+ // and avoid triggering NodeBB ACP tab navigation side-effects.
438
+ try {
439
+ ev.preventDefault();
440
+ ev.stopPropagation();
441
+ } catch (e) {}
435
442
  const action = btn.getAttribute('data-action');
436
443
  const rid = btn.getAttribute('data-rid');
437
444
  if (!rid) return;