-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
21 lines (18 loc) · 831 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import { lazyLoadImages } from './src/lazy-load';
import { addMarkupToPage } from './src/markup';
import { handleButtonNavigation, handleDotNavigation, setSlideLinkTabindex } from './src/navigation';
import './src/scss/styles.scss';
if (typeof NodeList !== "undefined" && NodeList.prototype && !NodeList.prototype.forEach) {
NodeList.prototype.forEach = Array.prototype.forEach;
}
if (typeof NodeList !== "undefined" && NodeList.prototype && !NodeList.prototype.indexOf) {
NodeList.prototype.indexOf = Array.prototype.indexOf;
}
export function init(elementId, data) {
addMarkupToPage(elementId, data)
const slides = document.querySelectorAll('.whirli-slide');
if (data.showButtons) handleButtonNavigation(slides);
if (data.showDots) handleDotNavigation(slides);
setSlideLinkTabindex(slides);
lazyLoadImages();
}