@bebranded/bb-contents 1.1.20 → 1.1.21
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 +5 -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.1.
|
|
4
|
+
* @version 1.1.21
|
|
5
5
|
* @author BeBranded
|
|
6
6
|
* @license MIT
|
|
7
7
|
* @website https://www.bebranded.xyz
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
'use strict';
|
|
11
11
|
|
|
12
12
|
// Version du script
|
|
13
|
-
const BB_CONTENTS_VERSION = '1.1.
|
|
13
|
+
const BB_CONTENTS_VERSION = '1.1.21';
|
|
14
14
|
|
|
15
15
|
// Créer l'objet temporaire pour la configuration si il n'existe pas
|
|
16
16
|
if (!window._bbContentsConfig) {
|
|
@@ -317,7 +317,7 @@
|
|
|
317
317
|
var marqueeEl = dropdown.closest('[data-bb-marquee-processed]');
|
|
318
318
|
|
|
319
319
|
function updatePortalPosition() {
|
|
320
|
-
if (!portalWrapper
|
|
320
|
+
if (!portalWrapper) return;
|
|
321
321
|
var rect = toggle.getBoundingClientRect();
|
|
322
322
|
portalWrapper.style.right = (window.innerWidth - rect.right) + 'px';
|
|
323
323
|
portalWrapper.style.top = rect.top + 'px';
|
|
@@ -350,7 +350,6 @@
|
|
|
350
350
|
portalWrapper.className = 'w-dropdown';
|
|
351
351
|
portalWrapper.style.cssText =
|
|
352
352
|
'position:fixed;transform:translateY(-100%);margin-top:-4px;z-index:9999;background:none;border:none;';
|
|
353
|
-
updatePortalPosition();
|
|
354
353
|
var clone = list.cloneNode(true);
|
|
355
354
|
clone.style.display = 'block';
|
|
356
355
|
clone.style.background = listStyle.background || listStyle.backgroundColor || 'transparent';
|
|
@@ -365,9 +364,10 @@
|
|
|
365
364
|
leaveTimer = setTimeout(closePortal, 120);
|
|
366
365
|
});
|
|
367
366
|
document.body.appendChild(portalWrapper);
|
|
367
|
+
updatePortalPosition();
|
|
368
368
|
dropdown.classList.add('w--open');
|
|
369
369
|
var onScrollOrResize = function() {
|
|
370
|
-
updatePortalPosition();
|
|
370
|
+
if (portalWrapper && portalWrapper.parentNode) updatePortalPosition();
|
|
371
371
|
};
|
|
372
372
|
window.addEventListener('scroll', onScrollOrResize, true);
|
|
373
373
|
window.addEventListener('resize', onScrollOrResize);
|