Updated Branches: refs/heads/develop 5fa8da9df -> 57c1ce09a
Fixed tab bug in docs javascript Tabs did not work correctly if they appeared more than once on the same docs page. Fixed javascript to work correctly in that case. Signed-off-by: Ivan Habunek <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/logging-log4php/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4php/commit/5be1052a Tree: http://git-wip-us.apache.org/repos/asf/logging-log4php/tree/5be1052a Diff: http://git-wip-us.apache.org/repos/asf/logging-log4php/diff/5be1052a Branch: refs/heads/develop Commit: 5be1052a57c5d7fc402ccdeae8395addf7081727 Parents: 5fa8da9 Author: Ivan Habunek <[email protected]> Authored: Sat Dec 14 18:05:56 2013 +0100 Committer: Ivan Habunek <[email protected]> Committed: Sat Dec 14 18:05:56 2013 +0100 ---------------------------------------------------------------------- docs/_theme/log4php-sphinx13/static/log4php.js | 27 +++++++++++++++------ 1 file changed, 20 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/logging-log4php/blob/5be1052a/docs/_theme/log4php-sphinx13/static/log4php.js ---------------------------------------------------------------------- diff --git a/docs/_theme/log4php-sphinx13/static/log4php.js b/docs/_theme/log4php-sphinx13/static/log4php.js index 4f9b92c..6ae847f 100644 --- a/docs/_theme/log4php-sphinx13/static/log4php.js +++ b/docs/_theme/log4php-sphinx13/static/log4php.js @@ -40,16 +40,29 @@ function reformatTabs() function activateTabs() { + // Hide all tabs $('.container.tabs > div').hide(); - $('.container.tabs > div:first').show(); - $('.container.tabs ul li:first').addClass('active'); - $('.container.tabs ul li a').click(function(){ - $('.container.tabs ul li').removeClass('active'); - $(this).parent().addClass('active'); + // For each tabs container show first tab and activate first label + $('.container.tabs').each(function() { + $(this).children('div:first').show(); + $(this).find('li:first').addClass('active'); + }); + + // On tab click + $('.container.tabs ul li a').click(function(event) { + + event.preventDefault(); + + var list_item = $(this).parent(); + var list = list_item.parent(); + var container = list.parent(); + + list.children().removeClass('active'); + list_item.addClass('active'); + + container.children('div').hide(); var currentTab = $(this).attr('href'); - $('.container.tabs > div').hide(); $(currentTab).show(); - return false; }); }
