Skip to content

Commit

Permalink
tabs
Browse files Browse the repository at this point in the history
  • Loading branch information
dgrammatiko committed Apr 20, 2017
1 parent 13469ba commit 66a3f94
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 20 deletions.
22 changes: 3 additions & 19 deletions media/system/js/bootstrap-init.js
Expand Up @@ -132,26 +132,10 @@
$.each($('#' + index + 'Content').find('.tab-pane'), function(i, v) {
if ($(v).data('node')) {
var attribs = $(v).data('node').split('['),
classLi = (attribs[0] != '') ? 'class="nav-item ' + attribs[0] + '"' : '';
$('#' + index + 'Tabs').append('<li ' + classLi + '><a class="nav-link" href="#' + attribs[1] + '" data-toggle="tab">' + attribs[2] + '</a></li>');
}
});

var liNodes = $('#' + index + 'Tabs').find('li');

$.each(liNodes, function() {
$(this).click(function (e) {
e.preventDefault();
var liNodes = $(e.target).parents('ul');
liNodes = liNodes.find('li');
classLink = (attribs[0] != '') ? 'class="nav-link ' + attribs[0] + '"' : 'class="nav-link"';

$.each(liNodes, function(index, value) {
$(value).removeClass("active");
$(value).find('a').removeClass("active");
});

$(this).tab("show");
});
$('#' + index + 'Tabs').append('<li class="nav-item"><a ' + classLink + ' href="#' + attribs[1] + '" data-toggle="tab">' + attribs[2] + '</a></li>');
}
});
});
}
Expand Down
2 changes: 1 addition & 1 deletion media/system/js/bootstrap-init.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 66a3f94

Please sign in to comment.