1
0
mirror of https://github.com/e107inc/e107.git synced 2025-07-27 18:00:30 +02:00

Added options to e_form->carousel() to disable navigation and indicators. Custom navigation can now display a custom label when 'label' is included in the carousel array.

This commit is contained in:
Cameron
2020-02-19 10:25:22 -08:00
parent 0dbad5d72b
commit b59e55339c
2 changed files with 25 additions and 9 deletions

View File

@@ -852,10 +852,22 @@ $(document).ready(function()
$('body').on('slid.bs.carousel', '.carousel', function(){
var currentIndex = $(this).find('.active').index();
var text = (currentIndex + 1);
var id = $(this).attr('id') + '-index'; // admin-ui-carousel-index etc.
$('#'+id).text(text);
var label = $(this).find('.active').attr('data-label');
var id = $(this).attr('id') + '-index'; // admin-ui-carousel-index etc.
if(label !== undefined)
{
$('#'+id).text(label);
}
else
{
var currentIndex = $(this).find('.active').index();
var text = (currentIndex + 1);
$('#'+id).text(text);
}
// this takes commented content for each carousel slide and enables it, one slide at a time as we scroll.