Elastic: Add possibility to assign classes to .nav-link elements when converting fieldsets to tabs

pull/6256/head
Aleksander Machniak 7 years ago
parent a889f55c31
commit 0366d40bf9

@ -802,12 +802,13 @@ function rcube_elastic_ui()
var tabs = [], nav = $('<ul>').attr({'class': 'nav nav-tabs', role: 'tablist'}); var tabs = [], nav = $('<ul>').attr({'class': 'nav nav-tabs', role: 'tablist'});
$(this).addClass('tab-content').children('fieldset').each(function(i, fieldset) { $(this).addClass('tab-content').children('fieldset').each(function(i, fieldset) {
var tab, id = fieldset.id || ('tab' + idx + '-' + i); var tab, id = fieldset.id || ('tab' + idx + '-' + i),
tab_class = $(fieldset).data('navlink-class');
$(fieldset).addClass('tab-pane').attr({id: id, role: 'tabpanel'}); $(fieldset).addClass('tab-pane').attr({id: id, role: 'tabpanel'});
tab = $('<li>').addClass('nav-item').append( tab = $('<li>').addClass('nav-item').append(
$('<a>').addClass('nav-link') $('<a>').addClass('nav-link' + (tab_class ? ' ' + tab_class : ''))
.attr({role: 'tab', 'href': '#' + id}) .attr({role: 'tab', 'href': '#' + id})
.text($('legend:first', fieldset).text()) .text($('legend:first', fieldset).text())
.click(function() { .click(function() {

Loading…
Cancel
Save