Skip to content

Commit 8417d6d

Browse files
committed
carousel automatic cycling is now optional
1 parent d57be13 commit 8417d6d

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

examples/official-site/sqlpage/migrations/34_carousel.sql

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,14 @@ VALUES (
6060
'NUMBER',
6161
TRUE,
6262
TRUE
63+
),
64+
(
65+
'carousel',
66+
'auto',
67+
'Whether to automatically cycle through the carousel items. Default is false.',
68+
'BOOLEAN',
69+
TRUE,
70+
TRUE
6371
),
6472
(
6573
'carousel',
@@ -127,7 +135,7 @@ VALUES (
127135
'An advanced example of carousel with controls',
128136
JSON(
129137
'[
130-
{"component":"carousel","name":"cats2","title":"Cats","width":6,"center":"TRUE","controls":"TRUE"},
138+
{"component":"carousel","name":"cats2","title":"Cats","width":6,"center":true,"controls":true,"auto":true},
131139
{"image":"https://upload.wikimedia.org/wikipedia/commons/thumb/2/29/Cat_Sphynx._Kittens._img_11.jpg/1024px-Cat_Sphynx._Kittens._img_11.jpg","title":"A first cat","description":"The cat (Felis catus), commonly referred to as the domestic cat or house cat, is the only domesticated species in the family Felidae."},
132140
{"image":"https://upload.wikimedia.org/wikipedia/commons/thumb/e/ec/Cat_close-up_2004_b.jpg/1280px-Cat_close-up_2004_b.jpg","title":"Another cat"}
133141
]'

sqlpage/templates/carousel.handlebars

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<div class="subheader">{{title}}</div>
66
</div>
77
{{/if}}
8-
<div id="{{name}}" class="carousel slide{{#if fade}} carousel-fade{{/if}}" data-bs-ride="carousel">
8+
<div id="{{name}}" class="carousel slide{{#if fade}} carousel-fade{{/if}}" {{#if auto}}data-bs-ride="carousel"{{/if}}>
99
<div class="carousel-indicators{{#if indicators}} carousel-indicators-{{indicators}}{{/if}}{{#if vertical}} carousel-indicators-vertical{{/if}}">
1010
{{#each_row}}
1111
<button type="button" data-bs-target="#{{../name}}" data-bs-slide-to="{{@row_index}}" {{#if (eq @row_index 0)}}class="active"{{/if}}></button>

0 commit comments

Comments
 (0)