@brandocms/jupiter 3.51.0 → 3.52.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brandocms/jupiter",
3
- "version": "3.51.0",
3
+ "version": "3.52.0",
4
4
  "description": "Frontend helpers.",
5
5
  "author": "Univers/Twined",
6
6
  "license": "UNLICENSED",
@@ -120,9 +120,11 @@ export default class Cookies {
120
120
  this.btn.addEventListener('click', () => {
121
121
  this.opts.onAccept(this)
122
122
  })
123
- this.btnRefuse.addEventListener('click', () => {
124
- this.opts.onRefuse(this)
125
- })
123
+ if (this.btnRefuse) {
124
+ this.btnRefuse.addEventListener('click', () => {
125
+ this.opts.onRefuse(this)
126
+ })
127
+ }
126
128
  }
127
129
 
128
130
  getCookie(sKey) {
@@ -42,6 +42,11 @@ const DEFAULT_OPTIONS = {
42
42
  */
43
43
  clearNestedSections: true,
44
44
 
45
+ /**
46
+ * Clear out all nested [data-moonwalk]s
47
+ */
48
+ clearNestedWalks: true,
49
+
45
50
  /**
46
51
  * If page is linked with an anchor, remove moonwalk for the page
47
52
  */
@@ -116,6 +121,12 @@ export default class Moonwalk {
116
121
  .forEach(ms => ms.removeAttribute('data-moonwalk-section'))
117
122
  }
118
123
 
124
+ if (this.opts.clearNestedWalks) {
125
+ container
126
+ .querySelectorAll('[data-moonwalk] [data-moonwalk]')
127
+ .forEach(ms => ms.removeAttribute('data-moonwalk'))
128
+ }
129
+
119
130
  this.addClass()
120
131
  this.sections = this.initializeSections(container)
121
132
  this.runs = this.initializeRuns(container)