').insertAfter(rowBoundary.parent()).append(rowBoundary.nextAll().addBack());
});
$('#carousel-thumbs .carousel-item .row:nth-child(even)').each(function() {
var boundary = $(this);
$('
').insertAfter(boundary.parent()).append(boundary.nextAll().addBack());
});
}
// Hide slide arrows if too few items.
if ($('#carousel-thumbs .carousel-item').length < 2) {
$('#carousel-thumbs [class^=carousel-control-]').remove();
$('.machine-carousel-container #carousel-thumbs').css('padding','0 5px');
}
// when the carousel slides, auto update
$('#myCarousel').on('slide.bs.carousel', function(e) {
var id = parseInt( $(e.relatedTarget).attr('data-slide-number') );
$('[id^=carousel-selector-]').removeClass('selected');
$('[id=carousel-selector-'+id+']').addClass('selected');
});
// when user swipes, go next or previous
$('#myCarousel').swipe({
fallbackToMouseEvents: true,
swipeLeft: function(e) {
$('#myCarousel').carousel('next');
},
swipeRight: function(e) {
$('#myCarousel').carousel('prev');
},
allowPageScroll: 'vertical',
preventDefaultEvents: false,
threshold: 75
});
/*
$(document).on('click', '[data-toggle="lightbox"]', function(event) {
event.preventDefault();
$(this).ekkoLightbox();
});
*/
$('#myCarousel .carousel-item img').on('click', function(e) {
var src = $(e.target).attr('data-remote');
if (src) $(this).ekkoLightbox();
});