2020-10-14 12:15:09 +02:00
|
|
|
import {UIEventSource} from "../../Logic/UIEventSource";
|
2021-06-11 22:51:45 +02:00
|
|
|
import BaseUIElement from "../BaseUIElement";
|
2021-06-14 19:21:33 +02:00
|
|
|
import $ from "jquery"
|
2020-06-24 00:35:19 +02:00
|
|
|
|
2021-06-11 22:51:45 +02:00
|
|
|
export class SlideShow extends BaseUIElement {
|
2020-06-24 00:35:19 +02:00
|
|
|
|
|
|
|
|
2021-06-14 19:21:33 +02:00
|
|
|
private readonly embeddedElements: UIEventSource<BaseUIElement[]>;
|
|
|
|
|
|
|
|
constructor(embeddedElements: UIEventSource<BaseUIElement[]>) {
|
2021-06-11 22:51:45 +02:00
|
|
|
super()
|
2021-06-14 19:21:33 +02:00
|
|
|
this.embeddedElements = embeddedElements;
|
|
|
|
}
|
|
|
|
|
|
|
|
protected InnerConstructElement(): HTMLElement {
|
2021-06-11 22:51:45 +02:00
|
|
|
const el = document.createElement("div")
|
2021-06-14 19:21:33 +02:00
|
|
|
el.classList.add("slic-carousel")
|
|
|
|
|
|
|
|
this.embeddedElements.addCallbackAndRun(elements => {
|
2021-06-11 22:51:45 +02:00
|
|
|
for (const element of elements ?? []) {
|
|
|
|
element.SetClass("slick-carousel-content")
|
2021-06-14 19:21:33 +02:00
|
|
|
el.appendChild(element.ConstructElement())
|
2021-06-11 22:51:45 +02:00
|
|
|
}
|
2021-01-29 03:23:53 +01:00
|
|
|
});
|
2021-06-11 22:51:45 +02:00
|
|
|
|
2021-06-14 19:21:33 +02:00
|
|
|
return el;
|
2021-01-29 03:23:53 +01:00
|
|
|
}
|
|
|
|
|
2020-09-13 03:29:44 +02:00
|
|
|
}
|