nodebb-plugin-onekite-calendar 2.0.4 → 2.0.5
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/CHANGELOG.md +3 -0
- package/package.json +1 -1
- package/plugin.json +1 -1
- package/public/admin.js +11 -5
- package/public/client.js +16 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
# Changelog – calendar-onekite
|
|
2
2
|
|
|
3
|
+
## 1.2.12
|
|
4
|
+
- Modales (calendrier + ACP) : autocomplete adresse rendu identique et compatible Bootstrap input-group (plus de wrapper qui casse l’affichage)
|
|
5
|
+
|
|
3
6
|
## 1.2.11
|
|
4
7
|
- ACP : ajout de la recherche automatique d’adresse (autocomplete Nominatim) dans la modale de validation (unitaire + batch), comme sur le calendrier
|
|
5
8
|
|
package/package.json
CHANGED
package/plugin.json
CHANGED
package/public/admin.js
CHANGED
|
@@ -220,11 +220,18 @@ define('admin/plugins/calendar-onekite', ['alerts', 'bootbox'], function (alerts
|
|
|
220
220
|
if (inputEl.getAttribute('data-onekite-autocomplete') === '1') return;
|
|
221
221
|
inputEl.setAttribute('data-onekite-autocomplete', '1');
|
|
222
222
|
|
|
223
|
-
|
|
224
|
-
|
|
223
|
+
// In Bootstrap input-groups (especially in ACP), wrapping the input breaks layout.
|
|
224
|
+
// So we anchor the menu to the closest input-group (or parent) without moving the input.
|
|
225
|
+
const anchor = inputEl.closest && inputEl.closest('.input-group')
|
|
226
|
+
? inputEl.closest('.input-group')
|
|
227
|
+
: (inputEl.parentNode || document.body);
|
|
225
228
|
|
|
226
|
-
|
|
227
|
-
|
|
229
|
+
try {
|
|
230
|
+
const cs = window.getComputedStyle(anchor);
|
|
231
|
+
if (!cs || cs.position === 'static') {
|
|
232
|
+
anchor.style.position = 'relative';
|
|
233
|
+
}
|
|
234
|
+
} catch (e) {
|
|
228
235
|
anchor.style.position = 'relative';
|
|
229
236
|
}
|
|
230
237
|
|
|
@@ -242,7 +249,6 @@ define('admin/plugins/calendar-onekite', ['alerts', 'bootbox'], function (alerts
|
|
|
242
249
|
menu.style.overflowY = 'auto';
|
|
243
250
|
menu.style.display = 'none';
|
|
244
251
|
menu.style.borderRadius = '0 0 .375rem .375rem';
|
|
245
|
-
menu.style.boxShadow = '0 .25rem .75rem rgba(0,0,0,.08)';
|
|
246
252
|
anchor.appendChild(menu);
|
|
247
253
|
|
|
248
254
|
let timer = null;
|
package/public/client.js
CHANGED
|
@@ -638,10 +638,20 @@ function attachAddressAutocomplete(inputEl, onPick) {
|
|
|
638
638
|
if (inputEl.getAttribute('data-onekite-autocomplete') === '1') return;
|
|
639
639
|
inputEl.setAttribute('data-onekite-autocomplete', '1');
|
|
640
640
|
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
inputEl.
|
|
644
|
-
|
|
641
|
+
// In Bootstrap input-groups (especially in ACP), wrapping the input breaks layout.
|
|
642
|
+
// So we anchor the menu to the closest input-group (or parent) without moving the input.
|
|
643
|
+
const host = inputEl.closest && inputEl.closest('.input-group')
|
|
644
|
+
? inputEl.closest('.input-group')
|
|
645
|
+
: (inputEl.parentNode || document.body);
|
|
646
|
+
|
|
647
|
+
try {
|
|
648
|
+
const cs = window.getComputedStyle(host);
|
|
649
|
+
if (!cs || cs.position === 'static') {
|
|
650
|
+
host.style.position = 'relative';
|
|
651
|
+
}
|
|
652
|
+
} catch (e) {
|
|
653
|
+
host.style.position = 'relative';
|
|
654
|
+
}
|
|
645
655
|
|
|
646
656
|
const menu = document.createElement('div');
|
|
647
657
|
menu.className = 'onekite-autocomplete-menu';
|
|
@@ -657,7 +667,7 @@ function attachAddressAutocomplete(inputEl, onPick) {
|
|
|
657
667
|
menu.style.overflowY = 'auto';
|
|
658
668
|
menu.style.display = 'none';
|
|
659
669
|
menu.style.borderRadius = '0 0 .375rem .375rem';
|
|
660
|
-
|
|
670
|
+
host.appendChild(menu);
|
|
661
671
|
|
|
662
672
|
let timer = null;
|
|
663
673
|
let lastQuery = '';
|
|
@@ -735,7 +745,7 @@ function attachAddressAutocomplete(inputEl, onPick) {
|
|
|
735
745
|
// Close when clicking outside
|
|
736
746
|
document.addEventListener('click', (e) => {
|
|
737
747
|
try {
|
|
738
|
-
if (!
|
|
748
|
+
if (!host.contains(e.target)) hide();
|
|
739
749
|
} catch (err) {}
|
|
740
750
|
});
|
|
741
751
|
|