File tree Expand file tree Collapse file tree
modules/edw_paragraphs/modules/edw_paragraphs_carousel/components/slider Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -26,6 +26,16 @@ props:
2626 title : Slider fade effect
2727 description : Slider fade effect, default -> false.
2828 default : false
29+ autoplay :
30+ type : boolean
31+ title : Autoplay
32+ description : Enables Autoplay
33+ default : false
34+ autoplaySpeed :
35+ type : integer
36+ title : Autoplay speed
37+ description : Autoplay speed in ms.
38+ default : true
2939
3040 slider_classes :
3141 type : array
4757libraryOverrides :
4858 dependencies :
4959 - edw_paragraphs_carousel/carousel
50- - drupal /once
60+ - core /once
5161
Original file line number Diff line number Diff line change 1111 const arrows = JSON . parse ( carousel . getAttribute ( 'data-arrows' ) ) ;
1212 const infinite = JSON . parse ( carousel . getAttribute ( 'data-infinite' ) ) ;
1313 const fade = JSON . parse ( carousel . getAttribute ( 'data-fade' ) ) ;
14+ const autoplay = JSON . parse ( carousel . getAttribute ( 'data-autoplay' ) ) ;
15+ const autoplaySpeed = JSON . parse ( carousel . getAttribute ( 'data-autoplay-speed' ) ) ;
1416
1517 $ ( '.slider' ) . slick ( {
1618 dots : dots ,
19+ autoplay : autoplay ,
20+ autoplaySpeed : parseInt ( autoplaySpeed , 10 ) ,
1721 infinite : infinite ,
1822 fade : fade ,
19- arrows : arrows ,
23+ arrows : arrows
2024 } ) ;
2125 } ) ;
2226 }
Original file line number Diff line number Diff line change 2020 {% set dots = dots ? ' true' : ' false' %}
2121{% endif %}
2222
23+ {% if autoplay is not defined %}
24+ {% set autoplay = ' false' %}
25+ {% else %}
26+ {% set autoplay = autoplay ? ' true' : ' false' %}
27+ {% endif %}
28+
29+ {% if autoplaySpeed is not defined %}
30+ {% set autoplaySpeed = 2000 %}
31+ {% endif %}
32+
2333{% if arrows is not defined %}
2434 {% set arrows = ' true' %}
2535{% else %}
4353{% set slider_attributes = slider_attributes.setAttribute (' data-infinite' , infinite ) %}
4454{% set slider_attributes = slider_attributes.setAttribute (' data-arrows' , arrows ) %}
4555{% set slider_attributes = slider_attributes.setAttribute (' data-fade' , fade ) %}
56+ {% set slider_attributes = slider_attributes.setAttribute (' data-autoplay' , autoplay ) %}
57+ {% set slider_attributes = slider_attributes.setAttribute (' data-autoplay-speed' , autoplaySpeed ) %}
4658
4759<div class =" grid-container" >
4860 <div {{ slider_attributes.addClass (slider_classes ) }}>
You can’t perform that action at this time.
0 commit comments