@bebranded/bb-contents 1.0.152 → 1.0.153
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 +13 -5
- package/package.json +1 -1
package/bb-contents.js
CHANGED
|
@@ -32,7 +32,7 @@
|
|
|
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.153');
|
|
36
36
|
|
|
37
37
|
// Configuration
|
|
38
38
|
const config = {
|
|
@@ -460,10 +460,11 @@
|
|
|
460
460
|
const textContainers = item.querySelectorAll('.use-case_client, .testimonial_client-info, [class*="text"], p, span');
|
|
461
461
|
textContainers.forEach(container => {
|
|
462
462
|
// Exclure les éléments qui doivent garder leur taille auto (tags, badges, etc.)
|
|
463
|
+
const containerStyle = container.getAttribute('style');
|
|
463
464
|
const shouldPreserveAuto = container.classList.contains('tag-m') ||
|
|
464
465
|
container.classList.contains('tag') ||
|
|
465
466
|
container.classList.contains('badge') ||
|
|
466
|
-
|
|
467
|
+
(containerStyle && containerStyle.includes('width'));
|
|
467
468
|
|
|
468
469
|
if (shouldPreserveAuto) {
|
|
469
470
|
// Ne pas toucher à ces éléments, ils gardent leur taille auto
|
|
@@ -665,8 +666,10 @@
|
|
|
665
666
|
waitForImagesRender(repeatBlock2),
|
|
666
667
|
forceFullRender() // NOUVEAU: Forcer le rendu complet
|
|
667
668
|
]).then(function() {
|
|
668
|
-
// Retirer les copies du conteneur temporaire
|
|
669
|
-
document.body
|
|
669
|
+
// Retirer les copies du conteneur temporaire (si toujours présent)
|
|
670
|
+
if (tempContainer && tempContainer.parentNode === document.body) {
|
|
671
|
+
document.body.removeChild(tempContainer);
|
|
672
|
+
}
|
|
670
673
|
|
|
671
674
|
// Maintenant ajouter les copies au scrollContainer
|
|
672
675
|
// Les images sont maintenant complètement rendues
|
|
@@ -726,7 +729,12 @@
|
|
|
726
729
|
});
|
|
727
730
|
}.bind(this));
|
|
728
731
|
}.bind(this)).catch(function() {
|
|
729
|
-
// En cas d'erreur,
|
|
732
|
+
// En cas d'erreur, nettoyer le tempContainer s'il existe
|
|
733
|
+
if (tempContainer && tempContainer.parentNode === document.body) {
|
|
734
|
+
document.body.removeChild(tempContainer);
|
|
735
|
+
}
|
|
736
|
+
|
|
737
|
+
// Créer les copies quand même et démarrer
|
|
730
738
|
const repeatBlock1 = mainBlock.cloneNode(true);
|
|
731
739
|
const repeatBlock2 = mainBlock.cloneNode(true);
|
|
732
740
|
|