make TOC collapse and expand

Change-Id: I8083c705c357f3ed45ab1eab5022615cbf2f7612
This commit is contained in:
Jim Phillips 2015-06-24 18:06:29 -04:00
parent a6b3443d63
commit 3aedff2bd6
4 changed files with 56 additions and 0 deletions

View File

@ -150,6 +150,21 @@ function populateContent(callback){
callback();
}
function prepareList(){
$('#contents ul.simple').find('li:has(ul)').unbind('click').click(function(event) {
if(this == event.target) {
$(this).toggleClass('expanded');
$(this).children('ul').toggle('medium');
}
return false;
}).addClass('collapsed').removeClass('expanded').children('ul').hide();
$('#contents ul.simple a').unbind('click').click(function() {
window.open($(this).attr('href'),'_self');
return false;
});
}
$(document).ready(function () {
var url = window.location.pathname;
var filename = url.substring(url.lastIndexOf('/') + 1);
@ -223,4 +238,7 @@ $(document).ready(function () {
var tab = $(this).attr('href');
$('.nav-tabs a[href="' + tab + '"]').tab('show');
});
prepareList();
});

Binary file not shown.

After

Width:  |  Height:  |  Size: 1000 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 995 B

View File

@ -540,6 +540,44 @@ i.fa-file-pdf-o {
display: none;
}
#contents ul.simple, #contents ul.simple li {
list-style: none;
margin:0;
padding:0;
cursor: pointer;
}
#contents ul.simple p {
margin:0;
display:block;
}
#contents ul.simple a:hover {
background-color:#F5F5F5;
}
#contents ul.simple li {
line-height:140%;
text-indent:0px;
background-position: 1px 3px;
padding-left: 20px;
background-repeat: no-repeat;
}
#contents ul.simple .collapsed {
background-image: url(collapsed.png);
}
#contents ul.simple .expanded {
background-image: url(expanded.png);
}
#contents ul.simple .expanded > ul{
padding-left: 0px;
margin-bottom: 5px;
}
div.topic {
padding: 7px;
}
@media (max-width: 767px) and (min-width: 0px) {
.navbar-default .navbar-text {
margin-left: 15px;