Skip to content

Commit

Permalink
Fix sponsor carousel for Bootstrap 5.
Browse files Browse the repository at this point in the history
  • Loading branch information
patfair committed Jul 20, 2024
1 parent 1b7f953 commit bf3a104
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 26 deletions.
2 changes: 1 addition & 1 deletion static/css/audience_display.css
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ html {
background-color: #fff;
text-align: center;
}
#sponsor .carousel-inner, #sponsor .item {
#sponsor .carousel-inner, #sponsor .carousel-item {
height: 100%;
}
.sponsor-image-container {
Expand Down
22 changes: 0 additions & 22 deletions static/js/audience_display.js
Original file line number Diff line number Diff line change
Expand Up @@ -760,28 +760,6 @@ const initializeSponsorDisplay = function() {
}
$("#sponsorContainer").append(slideHtml);
});

// Start Carousel
let t;
const start = $('.carousel#sponsor').find('.active').attr('data-interval');
t = setTimeout("$('.carousel#sponsor').carousel({interval: 1000});", start-1000);

$('.carousel#sponsor').on('slid.bs.carousel', function () {
clearTimeout(t);
const duration = $(this).find('.active').attr('data-interval');

$('.carousel#sponsor').carousel('pause');
t = setTimeout("$('.carousel#sponsor').carousel();", duration-1000);
});

$('.carousel-control.right').on('click', function(){
clearTimeout(t);
});

$('.carousel-control.left').on('click', function(){
clearTimeout(t);
});

});
};

Expand Down
6 changes: 3 additions & 3 deletions templates/audience_display.html
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@
<div id="bracket">
<img id="bracketSvg" src="" />
</div>
<div id="sponsor" class="carousel slide">
<div id="sponsor" class="carousel slide" data-bs-ride="carousel">
<div class="carousel-inner" id="sponsorContainer">
</div>
</div>
Expand Down Expand Up @@ -272,15 +272,15 @@
</table>
</script>
<script id="sponsorImageTemplate" type="text/x-handlebars-template">
<div class="item{{"{{#if First}}"}} active{{"{{/if}}"}}" data-interval="{{"{{DisplayTimeMs}}"}}">
<div class="carousel-item{{"{{#if First}}"}} active{{"{{/if}}"}}" data-bs-interval="{{"{{DisplayTimeMs}}"}}">
<div class="sponsor-image-container">
<img src="/static/img/sponsors/{{"{{Image}}"}}" />
</div>
<h1>{{"{{Subtitle}}"}}</h1>
</div>
</script>
<script id="sponsorTextTemplate" type="text/x-handlebars-template">
<div class="item{{"{{#if First}}"}} active{{"{{/if}}"}}" data-interval="{{"{{DisplayTimeMs}}"}}">
<div class="carousel-item{{"{{#if First}}"}} active{{"{{/if}}"}}" data-bs-interval="{{"{{DisplayTimeMs}}"}}">
<h2>{{"{{Line1}}"}}<br />{{"{{Line2}}"}}</h2>
<h1>{{"{{Subtitle}}"}}</h1>
</div>
Expand Down

0 comments on commit bf3a104

Please sign in to comment.