@brandocms/jupiter 3.46.0 → 3.46.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/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ #### 3.46.1
2
+
3
+ - Lazyload: Fix loading loop for Chrome. Only reset `sizes` on load for firefox browsers,
4
+ and when the image has not been loaded before.
5
+
6
+
1
7
  #### 3.46.0
2
8
 
3
9
  - **BREAKING** Marquee: Drop `paddingLeft` -- add `startProgress`. This sets where in the
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brandocms/jupiter",
3
- "version": "3.46.0",
3
+ "version": "3.46.1",
4
4
  "description": "Frontend helpers.",
5
5
  "author": "Univers/Twined",
6
6
  "license": "UNLICENSED",
@@ -187,18 +187,23 @@ export default class Lazyload {
187
187
  const img = picture.querySelector('img')
188
188
 
189
189
  const onload = () => {
190
+ if (!img.getAttribute('data-ll-loaded') && this.app.browser === 'firefox') {
191
+ // set sizes attribute on load again,
192
+ // since firefox sometimes is a bit slow to
193
+ // get the actual image width
194
+ const width = this.getWidth(img)
195
+
196
+ img.setAttribute('sizes', `${width}px`)
197
+ if (img.parentNode) {
198
+ Array.from(Dom.all(img.parentNode, 'source'))
199
+ .forEach(source => source.setAttribute('sizes', `${width}px`))
200
+ }
201
+ }
202
+
190
203
  img.removeAttribute('data-ll-placeholder')
191
204
  img.removeAttribute('data-ll-blurred')
192
205
  img.removeAttribute('data-ll-loading')
193
206
  img.setAttribute('data-ll-loaded', '')
194
-
195
- // set sizes attribute on load again, since firefox sometimes is a bit slow to
196
- // get the actual image width
197
- const width = this.getWidth(img)
198
- img.setAttribute('sizes', `${width}px`)
199
- if (img.parentNode) {
200
- Array.from(Dom.all(img.parentNode, 'source')).forEach(source => source.setAttribute('sizes', `${width}px`))
201
- }
202
207
  }
203
208
 
204
209
  img.addEventListener('load', onload, false)
@@ -249,7 +249,7 @@ export default class Moonwalk {
249
249
  }
250
250
 
251
251
  const timeline = gsap.timeline({
252
- // autoRemoveChildren: true
252
+ autoRemoveChildren: true,
253
253
  smoothChildTiming: true
254
254
  })
255
255
 
@@ -562,9 +562,13 @@ export default class Moonwalk {
562
562
  for (let i = 0; i < entries.length; i += 1) {
563
563
  const entry = entries[i]
564
564
 
565
- if (entry.isIntersecting) {
565
+ if (entry.isIntersecting || entry.intersectionRatio > 0) {
566
566
  section.running = true
567
567
 
568
+ if (entry.target.dataset.moonwalkId) {
569
+ console.debug('-- intersecting', entry.target.dataset.moonwalkId)
570
+ }
571
+
568
572
  const walkName = entry.target.getAttribute('data-moonwalk')
569
573
  const cfg = !walkName.length ? opts.walks.default : opts.walks[walkName]
570
574