@internetstiftelsen/styleguide 5.1.19-beta.0.2 → 5.1.19-beta.0.3
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.
|
@@ -15,6 +15,23 @@ if (gliderElementCourse) {
|
|
|
15
15
|
slidesToShow: 1,
|
|
16
16
|
slidesToScroll: 1
|
|
17
17
|
});
|
|
18
|
+
const readSpeakerSkipClass = 'RS_SKIP';
|
|
19
|
+
const slides = gliderElementCourse.querySelectorAll('.glider-slide');
|
|
20
|
+
const updateSlideClasses = (activeIndex)=>{
|
|
21
|
+
slides.forEach((slide, i)=>{
|
|
22
|
+
if (i === activeIndex) {
|
|
23
|
+
slide.classList.remove(readSpeakerSkipClass);
|
|
24
|
+
} else {
|
|
25
|
+
slide.classList.add(readSpeakerSkipClass);
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
// 👉 Apply classes immediately on page load
|
|
30
|
+
updateSlideClasses(GliderCourse.getCurrentSlide());
|
|
31
|
+
// 👉 Keep updating when slide changes
|
|
32
|
+
gliderElementCourse.addEventListener('glider-slide-visible', (event)=>{
|
|
33
|
+
updateSlideClasses(event.detail.slide);
|
|
34
|
+
});
|
|
18
35
|
const nextBtns = document.querySelectorAll('.js-glider-next');
|
|
19
36
|
const prevBtns = document.querySelectorAll('.js-glider-prev');
|
|
20
37
|
const siteMain = document.querySelector('#siteMain');
|
|
@@ -375,9 +375,8 @@ function makeGridOptionsFor(el) {
|
|
|
375
375
|
// dynamic JSON import based on *this* element's data attribute
|
|
376
376
|
const attr = el.dataset.json || './table.json';
|
|
377
377
|
const jsonUrl = new URL(attr, require("url").pathToFileURL(__filename).toString()).toString();
|
|
378
|
-
const mod = yield
|
|
379
|
-
|
|
380
|
-
const data = (_mod_default = mod == null ? void 0 : mod.default) != null ? _mod_default : mod;
|
|
378
|
+
const mod = yield fetch(jsonUrl);
|
|
379
|
+
const data = yield mod.json();
|
|
381
380
|
const cols = buildColumnDefsFromData(data);
|
|
382
381
|
params.api.setGridOption('columnDefs', cols);
|
|
383
382
|
params.api.setGridOption('rowData', data);
|