Skip to content

Commit

Permalink
bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
kattunga committed Dec 6, 2016
1 parent b335ddf commit 57f9c6b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 28 deletions.
17 changes: 0 additions & 17 deletions bootstrap-dynamic-tabs.css
Original file line number Diff line number Diff line change
Expand Up @@ -39,23 +39,6 @@
padding-bottom:10px;
}

.dynamic-tabs-container .tabs-dropdown .dropdown-menu .dropdown-header {
position: fixed;
left: 21px;
right: 21px;
background: #FFF;
margin-top: -50px;
padding-top: 18px;
border-radius: 4px 4px 0 0;
}
.dynamic-tabs-container .tabs-dropdown .dropdown-menu .close {
position: absolute;
top: 14px;
right: 20px;
}
.dynamic-tabs-container .tabs-dropdown .dropdown-menu .divider {
margin: 0;
}
.dynamic-tab {
width: 100%;
}
Expand Down
24 changes: 13 additions & 11 deletions bootstrap-dynamic-tabs.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,19 +99,21 @@
var $verticalContainer = $horizontalContainer.siblings(".tabs-dropdown").find(".dropdown-menu");

$verticalContainer.html("");
$verticalContainer.css("z-index", 1050);

$horizontalContainer.children('li').each( function (index, element) {
var htab = document.createElement("li");

$(htab).append('<a href="#">'+$(element).children('a').html()+'</a>');
$(htab).children('a').children('*').remove();
$(htab).toggleClass('active',$(element).hasClass('active'));
$(htab).attr("tab-id", index);
$(htab).on("click", function (e) {
$horizontalContainer.find("[tab-id=" + $(this).attr("tab-id") + "] a").tab("show");
updateTabs();
});
$verticalContainer.append(htab);
if ($(element).children('a').css("display") !== 'none') {
var htab = document.createElement("li");

$(htab).append('<a href="#">'+$(element).children('a').html()+'</a>');
$(htab).toggleClass('active',$(element).hasClass('active'));
$(htab).attr("tab-id", index);
$(htab).on("click", function (e) {
$horizontalContainer.find("[tab-id=" + $(this).attr("tab-id") + "] a").tab("show");
updateTabs();
});
$verticalContainer.append(htab);
}
});
};
$horizontalContainer.siblings(".tabs-dropdown").off('show.bs.dropdown').on('show.bs.dropdown', onDropDow);
Expand Down

0 comments on commit 57f9c6b

Please sign in to comment.