MCPcopy
hub / github.com/mdbootstrap/TW-Elements / dataApiClickHandler

Method dataApiClickHandler

src/js/free/components/carousel.js:738–762  ·  view source on GitHub ↗
(event)

Source from the content-addressed store, hash-verified

736 }
737
738 static dataApiClickHandler(event) {
739 const target = getElementFromSelector(this);
740
741 if (!target) {
742 return;
743 }
744
745 const config = {
746 ...Manipulator.getDataAttributes(target),
747 ...Manipulator.getDataAttributes(this),
748 };
749 const slideIndex = this.getAttribute("data-twe-slide-to");
750
751 if (slideIndex) {
752 config.interval = false;
753 }
754
755 Carousel.carouselInterface(target, config);
756
757 if (slideIndex) {
758 Carousel.getInstance(target).to(slideIndex);
759 }
760
761 event.preventDefault();
762 }
763}
764
765export default Carousel;

Callers

nothing calls this directly

Calls 4

getElementFromSelectorFunction · 0.90
carouselInterfaceMethod · 0.45
toMethod · 0.45
getInstanceMethod · 0.45

Tested by

no test coverage detected