@internetstiftelsen/styleguide 5.0.14-beta.0.4 → 5.0.14-beta.0.5
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.
|
@@ -23,7 +23,7 @@ var missingConsentMessage = 'För att spela Youtubefilmer krävs att "Riktade ka
|
|
|
23
23
|
function loadYoutubeAPI() {
|
|
24
24
|
var id = 'iisYoutubeAPI';
|
|
25
25
|
|
|
26
|
-
if (document.getElementById(id
|
|
26
|
+
if (document.getElementById(id)) {
|
|
27
27
|
return;
|
|
28
28
|
}
|
|
29
29
|
|
|
@@ -33,7 +33,9 @@ function loadYoutubeAPI() {
|
|
|
33
33
|
tag.id = id;
|
|
34
34
|
tag.src = 'https://www.youtube.com/iframe_api';
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
if (consent) {
|
|
37
|
+
firstScript.parentNode.insertBefore(tag, firstScript);
|
|
38
|
+
}
|
|
37
39
|
}
|
|
38
40
|
|
|
39
41
|
function onPlayerStateChange(el, e) {
|
package/package.json
CHANGED
package/src/assets/js/youtube.js
CHANGED
|
@@ -8,7 +8,7 @@ const missingConsentMessage = 'För att spela Youtubefilmer krävs att "Riktade
|
|
|
8
8
|
function loadYoutubeAPI() {
|
|
9
9
|
const id = 'iisYoutubeAPI';
|
|
10
10
|
|
|
11
|
-
if (document.getElementById(id
|
|
11
|
+
if (document.getElementById(id)) {
|
|
12
12
|
return;
|
|
13
13
|
}
|
|
14
14
|
|
|
@@ -18,7 +18,9 @@ function loadYoutubeAPI() {
|
|
|
18
18
|
tag.id = id;
|
|
19
19
|
tag.src = 'https://www.youtube.com/iframe_api';
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
if(consent) {
|
|
22
|
+
firstScript.parentNode.insertBefore(tag, firstScript);
|
|
23
|
+
}
|
|
22
24
|
}
|
|
23
25
|
|
|
24
26
|
function onPlayerStateChange(el, e) {
|