@bebranded/bb-contents 1.0.129 → 1.0.131
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/bb-contents.js +21 -5
- package/package.json +1 -1
package/bb-contents.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* BeBranded Contents
|
|
3
3
|
* Contenus additionnels français pour Webflow
|
|
4
|
-
* @version 1.0.
|
|
4
|
+
* @version 1.0.131
|
|
5
5
|
* @author BeBranded
|
|
6
6
|
* @license MIT
|
|
7
7
|
* @website https://www.bebranded.xyz
|
|
@@ -32,11 +32,11 @@
|
|
|
32
32
|
window._bbContentsInitialized = true;
|
|
33
33
|
|
|
34
34
|
// Log de démarrage simple (une seule fois)
|
|
35
|
-
console.log('bb-contents | v1.0.
|
|
35
|
+
console.log('bb-contents | v1.0.131');
|
|
36
36
|
|
|
37
37
|
// Configuration
|
|
38
38
|
const config = {
|
|
39
|
-
version: '1.0.
|
|
39
|
+
version: '1.0.131',
|
|
40
40
|
debug: false, // Debug désactivé pour rendu propre
|
|
41
41
|
prefix: 'bb-', // utilisé pour générer les sélecteurs (data-bb-*)
|
|
42
42
|
youtubeEndpoint: null, // URL du worker YouTube (à définir par l'utilisateur)
|
|
@@ -1427,7 +1427,7 @@
|
|
|
1427
1427
|
// Liste des pays
|
|
1428
1428
|
const list = document.createElement('div');
|
|
1429
1429
|
list.className = 'bb-country-list';
|
|
1430
|
-
list.style.cssText = 'overflow-y: auto; max-height: 250px;';
|
|
1430
|
+
list.style.cssText = 'overflow-y: auto; max-height: 250px; padding-bottom: 8px;';
|
|
1431
1431
|
popover.appendChild(list);
|
|
1432
1432
|
|
|
1433
1433
|
// Fonction pour rendre la liste
|
|
@@ -1441,7 +1441,7 @@
|
|
|
1441
1441
|
|
|
1442
1442
|
list.innerHTML = countries.map(function(country) {
|
|
1443
1443
|
const isSelected = currentSelectedCountry && currentSelectedCountry.alpha2 === country.alpha2;
|
|
1444
|
-
return '<div class="bb-country-item" data-country="' + country.alpha2 + '" role="option" aria-selected="' + (isSelected ? 'true' : 'false') + '" style="display: flex; align-items: center; gap: 8px; padding: 8px 12px; cursor: pointer; font-size: inherit; font-family: inherit; transition: background-color 0.15s;' + (isSelected ? ' background-color: #f3f4f6;' : '') + '"><img src="https://hatscripts.github.io/circle-flags/flags/' + country.alpha2.toLowerCase() + '.svg" alt="' + bbContents.utils.sanitize(country.name[language]) + '" style="width: 20px; height: 20px; border-radius: 50%; object-fit: cover; flex-shrink: 0;"><span>' + bbContents.utils.sanitize(country.name[language]) + '</span></div>';
|
|
1444
|
+
return '<div class="bb-country-item" data-country="' + country.alpha2 + '" role="option" aria-selected="' + (isSelected ? 'true' : 'false') + '" style="display: flex; align-items: center; gap: 8px; padding: 8px 12px; cursor: pointer; font-size: inherit; font-family: inherit; transition: background-color 0.15s; min-height: 36px; box-sizing: border-box;' + (isSelected ? ' background-color: #f3f4f6;' : '') + '"><img src="https://hatscripts.github.io/circle-flags/flags/' + country.alpha2.toLowerCase() + '.svg" alt="' + bbContents.utils.sanitize(country.name[language]) + '" style="width: 20px; height: 20px; border-radius: 50%; object-fit: cover; flex-shrink: 0;"><span style="line-height: 1.2;">' + bbContents.utils.sanitize(country.name[language]) + '</span></div>';
|
|
1445
1445
|
}).join('');
|
|
1446
1446
|
|
|
1447
1447
|
// Ajouter hover effect
|
|
@@ -1478,6 +1478,22 @@
|
|
|
1478
1478
|
trigger.addEventListener('click', function(e) {
|
|
1479
1479
|
e.stopPropagation();
|
|
1480
1480
|
const isOpen = popover.style.display === 'block';
|
|
1481
|
+
|
|
1482
|
+
// Fermer tous les autres dropdowns avant d'ouvrir celui-ci
|
|
1483
|
+
if (!isOpen) {
|
|
1484
|
+
document.querySelectorAll('.bb-country-select-popover').forEach(function(otherPopover) {
|
|
1485
|
+
if (otherPopover !== popover && otherPopover.style.display === 'block') {
|
|
1486
|
+
otherPopover.style.display = 'none';
|
|
1487
|
+
const otherTrigger = otherPopover.parentElement.querySelector('.bb-country-select-trigger');
|
|
1488
|
+
if (otherTrigger) {
|
|
1489
|
+
otherTrigger.setAttribute('aria-expanded', 'false');
|
|
1490
|
+
const otherChevron = otherTrigger.querySelector('svg');
|
|
1491
|
+
if (otherChevron) otherChevron.style.transform = 'rotate(0deg)';
|
|
1492
|
+
}
|
|
1493
|
+
}
|
|
1494
|
+
});
|
|
1495
|
+
}
|
|
1496
|
+
|
|
1481
1497
|
popover.style.display = isOpen ? 'none' : 'block';
|
|
1482
1498
|
trigger.setAttribute('aria-expanded', isOpen ? 'false' : 'true');
|
|
1483
1499
|
if (chevron) chevron.style.transform = isOpen ? 'rotate(0deg)' : 'rotate(180deg)';
|