@internetstiftelsen/styleguide 2.26.5-beta.1.0 → 2.26.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.
- package/dist/assets/js/ot.js +13 -0
- package/dist/assets/js/youtube.js +1 -2
- package/dist/atoms/height-limiter/height-limiter.js +7 -1
- package/dist/components.js +3 -1
- package/package.json +1 -1
- package/src/assets/js/ot.js +11 -0
- package/src/assets/js/youtube.js +1 -2
- package/src/atoms/height-limiter/_height-limiter.scss +10 -0
- package/src/atoms/height-limiter/height-limiter.config.js +9 -1
- package/src/atoms/height-limiter/height-limiter.js +7 -1
- package/src/components.js +1 -0
- package/src/organisms/hero/_hero.scss +2 -1
- package/src/organisms/hero/hero.config.js +1 -1
- package/src/organisms/schedule/_schedule.scss +5 -1
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
document.addEventListener('click', function (e) {
|
|
4
|
+
var el = e.target.closest('[data-ot-dynamic-show-settings]');
|
|
5
|
+
|
|
6
|
+
if (el) {
|
|
7
|
+
var otButton = document.getElementById('ot-sdk-btn');
|
|
8
|
+
|
|
9
|
+
if (otButton) {
|
|
10
|
+
otButton.click();
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
});
|
|
@@ -59,8 +59,7 @@ function createConsentWarning(el) {
|
|
|
59
59
|
div.setAttribute('data-youtube-consent-warning', true);
|
|
60
60
|
div.className = (0, _className2.default)('m-icon-overlay__message');
|
|
61
61
|
button.className = (0, _className2.default)('a-button');
|
|
62
|
-
button.
|
|
63
|
-
button.setAttribute('id', 'ot-sdk-btn');
|
|
62
|
+
button.setAttribute('data-ot-dynamic-show-settings', 'true');
|
|
64
63
|
button.innerHTML = '<span class="' + (0, _className2.default)('a-button__text') + '">Anpassa kakor</span>';
|
|
65
64
|
message.innerHTML = missingConsentMessage;
|
|
66
65
|
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var elements = document.querySelectorAll('.js-height-limit');
|
|
4
|
-
|
|
5
4
|
function update(innerContainer, button, height) {
|
|
6
5
|
if (button.classList.contains('is-clicked')) {
|
|
7
6
|
return;
|
|
@@ -25,6 +24,7 @@ function setup(element) {
|
|
|
25
24
|
var buttonTextElement = button.querySelector('span');
|
|
26
25
|
var buttonText = buttonTextElement.innerText;
|
|
27
26
|
var toggleText = element.getAttribute('data-toggle-text');
|
|
27
|
+
var topPosition = void 0;
|
|
28
28
|
|
|
29
29
|
update(innerContainer, button, height);
|
|
30
30
|
|
|
@@ -34,6 +34,12 @@ function setup(element) {
|
|
|
34
34
|
buttonTextElement.innerText = buttonTextElement.innerText === buttonText ? toggleText : buttonText;
|
|
35
35
|
button.classList.toggle('is-clicked');
|
|
36
36
|
|
|
37
|
+
if (!innerContainer.classList.contains('is-limited')) {
|
|
38
|
+
topPosition = document.documentElement.scrollTop;
|
|
39
|
+
} else {
|
|
40
|
+
window.scroll(0, topPosition);
|
|
41
|
+
}
|
|
42
|
+
|
|
37
43
|
setTimeout(function () {
|
|
38
44
|
return update(innerContainer, button, height);
|
|
39
45
|
}, 1);
|
package/dist/components.js
CHANGED
package/package.json
CHANGED
package/src/assets/js/youtube.js
CHANGED
|
@@ -44,8 +44,7 @@ function createConsentWarning(el) {
|
|
|
44
44
|
div.setAttribute('data-youtube-consent-warning', true);
|
|
45
45
|
div.className = className('m-icon-overlay__message');
|
|
46
46
|
button.className = className('a-button');
|
|
47
|
-
button.
|
|
48
|
-
button.setAttribute('id', 'ot-sdk-btn');
|
|
47
|
+
button.setAttribute('data-ot-dynamic-show-settings', 'true');
|
|
49
48
|
button.innerHTML = `<span class="${className('a-button__text')}">Anpassa kakor</span>`;
|
|
50
49
|
message.innerHTML = missingConsentMessage;
|
|
51
50
|
|
|
@@ -30,6 +30,16 @@
|
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
+
@include m(snow) {
|
|
34
|
+
@include e(inner) {
|
|
35
|
+
&.is-limited {
|
|
36
|
+
&::after {
|
|
37
|
+
background-image: linear-gradient(to bottom, rgba($color-snow, 0) 0%, rgba($color-snow, 1) 100%);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
33
43
|
@include e(btn) {
|
|
34
44
|
display: flex;
|
|
35
45
|
position: relative;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
const elements = document.querySelectorAll('.js-height-limit');
|
|
2
|
-
|
|
3
2
|
function update(innerContainer, button, height) {
|
|
4
3
|
if (button.classList.contains('is-clicked')) {
|
|
5
4
|
return;
|
|
@@ -23,6 +22,7 @@ function setup(element) {
|
|
|
23
22
|
const buttonTextElement = button.querySelector('span');
|
|
24
23
|
const buttonText = buttonTextElement.innerText;
|
|
25
24
|
const toggleText = element.getAttribute('data-toggle-text');
|
|
25
|
+
let topPosition;
|
|
26
26
|
|
|
27
27
|
update(innerContainer, button, height);
|
|
28
28
|
|
|
@@ -34,6 +34,12 @@ function setup(element) {
|
|
|
34
34
|
buttonTextElement.innerText === buttonText) ? toggleText : buttonText;
|
|
35
35
|
button.classList.toggle('is-clicked');
|
|
36
36
|
|
|
37
|
+
if (!innerContainer.classList.contains('is-limited')) {
|
|
38
|
+
topPosition = document.documentElement.scrollTop;
|
|
39
|
+
} else {
|
|
40
|
+
window.scroll(0, topPosition);
|
|
41
|
+
}
|
|
42
|
+
|
|
37
43
|
setTimeout(() => update(innerContainer, button, height), 1);
|
|
38
44
|
});
|
|
39
45
|
|
package/src/components.js
CHANGED
|
@@ -223,7 +223,6 @@
|
|
|
223
223
|
}
|
|
224
224
|
}
|
|
225
225
|
|
|
226
|
-
|
|
227
226
|
@include e(close-btn) {
|
|
228
227
|
position: absolute;
|
|
229
228
|
top: 0;
|
|
@@ -236,6 +235,10 @@
|
|
|
236
235
|
margin-bottom: rhythm(1);
|
|
237
236
|
align-items: center;
|
|
238
237
|
|
|
238
|
+
> span {
|
|
239
|
+
line-height: 1.2;
|
|
240
|
+
}
|
|
241
|
+
|
|
239
242
|
@include bp-up(lg) {
|
|
240
243
|
margin-bottom: 0;
|
|
241
244
|
}
|
|
@@ -248,6 +251,7 @@
|
|
|
248
251
|
|
|
249
252
|
> span {
|
|
250
253
|
text-align: center;
|
|
254
|
+
margin-top: rhythm(0.5);
|
|
251
255
|
}
|
|
252
256
|
}
|
|
253
257
|
}
|