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 +1 -1
- package/plugin.json +1 -1
- package/public/admin.js +9 -2
package/package.json
CHANGED
package/plugin.json
CHANGED
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
|
-
|
|
237
|
-
<button class="btn btn-
|
|
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;
|