diff --git a/static/css/style.css b/static/css/style.css index 299dc29..da1c51f 100644 --- a/static/css/style.css +++ b/static/css/style.css @@ -77,7 +77,16 @@ h4.author { font-size:14px; margin-bottom:5px; font-style:italic; } #menu-toggle-handle .icon-bar { display: block; margin:auto; width:22px; height:2px; background-color:#fff; border-radius:1px; } #menu-toggle-handle .icon-bar + .icon-bar { margin-top:4px; } -.dropdown-menu .glyphicon { padding-right:5px; } +.dropdown-menu .glyphicon { padding-right:5px; } + +/* Pills dropdown*/ +ul.nav.nav-pills li.dropdown:hover ul.dropdown-menu{ + display: block; +} + +ul.nav.nav-pills .dropdown-menu { + margin-top: 1px; +} a.rss { padding-left:23px; background:url(../img/rss.png) no-repeat left; } a.pdf { padding-left:23px; background-image:url(../img/pdf.png); background-repeat:no-repeat; background-position: top left; } diff --git a/static/js/main.js b/static/js/main.js index 3bce4ff..ea29e6a 100644 --- a/static/js/main.js +++ b/static/js/main.js @@ -1,5 +1,21 @@ $(function() { -$("#menu-toggle-handle").click(function(e) { $('#nav').slideToggle('fast'); }); +$('#menu-toggle-handle').click(function(e) { $('#nav').slideToggle('fast'); }); + +$('ul.nav.nav-pills > li').each( + function(){ + var _sameSection = $('li[data-section*="'+$(this).data('section')+'"]'); + if(_sameSection.length > 1 && !_sameSection.hasClass('dropdown')){ + _sameSection.first().addClass('dropdown') + .find('a:first') + .append(''); + + _sameSection.first().append(_sameSection.not(':first')); + _sameSection.not(':first').removeClass('active') + .wrapAll(''); + } + } +); + });