@brandocms/jupiter 3.43.0 → 3.44.0
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
package/package.json
CHANGED
package/src/modules/Dom/index.js
CHANGED
|
@@ -73,6 +73,10 @@ class DOM {
|
|
|
73
73
|
return classes.map(className => element.classList.toggle(className))
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
+
hasAttribute (element, attributeName) {
|
|
77
|
+
return element.hasAttribute(attributeName)
|
|
78
|
+
}
|
|
79
|
+
|
|
76
80
|
overlapsVertically ($div1, $div2) {
|
|
77
81
|
// Div 1 data
|
|
78
82
|
const d1Offset = $div1.getBoundingClientRect()
|
|
@@ -655,6 +655,10 @@ export default class Moonwalk {
|
|
|
655
655
|
let tweenPosition
|
|
656
656
|
const startingPoint = tweenDuration - tweenOverlap
|
|
657
657
|
|
|
658
|
+
if (Dom.hasAttribute(target, 'data-moonwalked')) {
|
|
659
|
+
return
|
|
660
|
+
}
|
|
661
|
+
|
|
658
662
|
if (section.timeline.isActive() && section.timeline.recent()) {
|
|
659
663
|
if (section.timeline.recent().time() > startingPoint) {
|
|
660
664
|
/* We're late for this tween if it was supposed to be sequential,
|
|
@@ -677,6 +681,7 @@ export default class Moonwalk {
|
|
|
677
681
|
},
|
|
678
682
|
tweenPosition()
|
|
679
683
|
)
|
|
684
|
+
.call(() => { target.setAttribute('data-moonwalked', '') }, null, '<')
|
|
680
685
|
|
|
681
686
|
if (alphaTween) {
|
|
682
687
|
section.timeline.to(target, {
|
|
@@ -701,7 +706,7 @@ export default class Moonwalk {
|
|
|
701
706
|
let tweenPosition
|
|
702
707
|
const startingPoint = tweenDuration - tweenOverlap
|
|
703
708
|
|
|
704
|
-
if (Dom.
|
|
709
|
+
if (Dom.hasAttribute(target, 'data-moonwalked')) {
|
|
705
710
|
return
|
|
706
711
|
}
|
|
707
712
|
|
|
@@ -726,6 +731,6 @@ export default class Moonwalk {
|
|
|
726
731
|
duration: tweenDuration
|
|
727
732
|
},
|
|
728
733
|
tweenPosition()
|
|
729
|
-
)
|
|
734
|
+
).call(() => { target.setAttribute('data-moonwalked', '') }, null, '<')
|
|
730
735
|
}
|
|
731
736
|
}
|