nodebb-plugin-calendar-onekite 12.0.0 → 12.0.1
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/public/client.js +20 -4
package/package.json
CHANGED
package/public/client.js
CHANGED
|
@@ -940,14 +940,28 @@ function toDatetimeLocalValue(date) {
|
|
|
940
940
|
try {
|
|
941
941
|
const btn = document.querySelector('#onekite-calendar .fc-newSpecial-button');
|
|
942
942
|
if (!btn) return;
|
|
943
|
+
|
|
943
944
|
const isSpecial = mode === 'special';
|
|
944
945
|
const label = isSpecial ? 'Évènement ✓' : 'Évènement';
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
946
|
+
|
|
947
|
+
// Ensure a single canonical .fc-button-text (prevents "ÉvènementÉvènement" after rerenders)
|
|
948
|
+
let span = btn.querySelector('.fc-button-text');
|
|
949
|
+
if (!span) {
|
|
950
|
+
span = document.createElement('span');
|
|
951
|
+
span.className = 'fc-button-text';
|
|
952
|
+
// Remove stray text nodes before inserting span
|
|
953
|
+
[...btn.childNodes].forEach((n) => {
|
|
954
|
+
if (n && n.nodeType === Node.TEXT_NODE) n.remove();
|
|
955
|
+
});
|
|
956
|
+
btn.appendChild(span);
|
|
948
957
|
} else {
|
|
949
|
-
|
|
958
|
+
// Remove any stray text nodes beside the span
|
|
959
|
+
[...btn.childNodes].forEach((n) => {
|
|
960
|
+
if (n && n.nodeType === Node.TEXT_NODE && n.textContent.trim()) n.remove();
|
|
961
|
+
});
|
|
950
962
|
}
|
|
963
|
+
|
|
964
|
+
span.textContent = label;
|
|
951
965
|
btn.classList.toggle('onekite-active', isSpecial);
|
|
952
966
|
} catch (e) {}
|
|
953
967
|
}
|
|
@@ -1742,6 +1756,8 @@ function toDatetimeLocalValue(date) {
|
|
|
1742
1756
|
calendar.setOption('titleFormat', mobile ? { year: 'numeric', month: 'short' } : undefined);
|
|
1743
1757
|
}
|
|
1744
1758
|
try { calendar.updateSize(); } catch (err) {}
|
|
1759
|
+
|
|
1760
|
+
try { refreshDesktopModeButton(); } catch (e) {}
|
|
1745
1761
|
});
|
|
1746
1762
|
} catch (e) {}
|
|
1747
1763
|
}
|