@internetstiftelsen/styleguide 5.0.14-beta.0.5 → 5.0.14-beta.0.7

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.
@@ -33,9 +33,7 @@ function loadYoutubeAPI() {
33
33
  tag.id = id;
34
34
  tag.src = 'https://www.youtube.com/iframe_api';
35
35
 
36
- if (consent) {
37
- firstScript.parentNode.insertBefore(tag, firstScript);
38
- }
36
+ firstScript.parentNode.insertBefore(tag, firstScript);
39
37
  }
40
38
 
41
39
  function onPlayerStateChange(el, e) {
@@ -109,6 +107,8 @@ function setupYoutubePlayer(el) {
109
107
  return;
110
108
  }
111
109
 
110
+ loadYoutubeAPI();
111
+
112
112
  var id = el.getAttribute('data-youtube');
113
113
  var playerEl = document.createElement('div');
114
114
 
@@ -184,11 +184,9 @@ window.onYouTubeIframeAPIReady = function () {
184
184
  };
185
185
 
186
186
  setupPlayers(document);
187
- loadYoutubeAPI();
188
187
 
189
188
  window.addEventListener('consent.onetrust', function (e) {
190
189
  consent = e.detail.includes('C0004');
191
190
 
192
191
  setupPlayers(document);
193
- loadYoutubeAPI();
194
192
  });
@@ -96,6 +96,7 @@ var elementIsInViewport = (0, _debounce2.default)(function () {
96
96
  window.addEventListener('scroll', function () {
97
97
  elementIsInViewport();
98
98
  });
99
+
99
100
  function closeForm() {
100
101
  setCookie(cookieName, 'YES', 7);
101
102
  slidingForm.classList.remove(visibleClass);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@internetstiftelsen/styleguide",
3
- "version": "5.0.14-beta.0.5",
3
+ "version": "5.0.14-beta.0.7",
4
4
  "main": "dist/components.js",
5
5
  "ports": {
6
6
  "fractal": "3000"
@@ -18,9 +18,7 @@ function loadYoutubeAPI() {
18
18
  tag.id = id;
19
19
  tag.src = 'https://www.youtube.com/iframe_api';
20
20
 
21
- if(consent) {
22
- firstScript.parentNode.insertBefore(tag, firstScript);
23
- }
21
+ firstScript.parentNode.insertBefore(tag, firstScript);
24
22
  }
25
23
 
26
24
  function onPlayerStateChange(el, e) {
@@ -94,6 +92,8 @@ function setupYoutubePlayer(el) {
94
92
  return;
95
93
  }
96
94
 
95
+ loadYoutubeAPI();
96
+
97
97
  const id = el.getAttribute('data-youtube');
98
98
  const playerEl = document.createElement('div');
99
99
 
@@ -167,11 +167,9 @@ window.onYouTubeIframeAPIReady = () => {
167
167
  };
168
168
 
169
169
  setupPlayers(document);
170
- loadYoutubeAPI();
171
170
 
172
171
  window.addEventListener('consent.onetrust', (e) => {
173
172
  consent = e.detail.includes('C0004');
174
173
 
175
174
  setupPlayers(document);
176
- loadYoutubeAPI();
177
175
  });
@@ -90,6 +90,8 @@ const elementIsInViewport = debounce(() => {
90
90
  window.addEventListener('scroll', () => {
91
91
  elementIsInViewport();
92
92
  });
93
+
94
+
93
95
  function closeForm() {
94
96
  setCookie(cookieName, 'YES', 7);
95
97
  slidingForm.classList.remove(visibleClass);