From 57f9c6b5ab04adf397c49350a28f83f5503c0281 Mon Sep 17 00:00:00 2001 From: Christian Date: Tue, 6 Dec 2016 15:17:14 -0300 Subject: [PATCH] bug fixes --- bootstrap-dynamic-tabs.css | 17 ----------------- bootstrap-dynamic-tabs.js | 24 +++++++++++++----------- 2 files changed, 13 insertions(+), 28 deletions(-) diff --git a/bootstrap-dynamic-tabs.css b/bootstrap-dynamic-tabs.css index 489aa38..5773c14 100644 --- a/bootstrap-dynamic-tabs.css +++ b/bootstrap-dynamic-tabs.css @@ -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%; } diff --git a/bootstrap-dynamic-tabs.js b/bootstrap-dynamic-tabs.js index fe025f0..28dfa4b 100644 --- a/bootstrap-dynamic-tabs.js +++ b/bootstrap-dynamic-tabs.js @@ -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(''+$(element).children('a').html()+''); - $(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(''+$(element).children('a').html()+''); + $(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);