mirror of
https://github.com/e107inc/e107.git
synced 2025-01-17 12:48:24 +01:00
47 lines
1.3 KiB
JavaScript
47 lines
1.3 KiB
JavaScript
/**************************************************************/
|
|
/* Prepares the cv to be dynamically expandable/collapsible */
|
|
/**************************************************************/
|
|
function pageNavList() {
|
|
|
|
$('ul.page-nav').find('li:has(ul)').attr('title', 'Expand/Collapse');
|
|
|
|
$('ul.page-nav').find('li:has(ul)')
|
|
.click( function(event) {
|
|
|
|
if (this == event.target) {
|
|
$(this).toggleClass('expanded');
|
|
$(this).children('ul').toggle('medium');
|
|
|
|
}
|
|
return false;
|
|
})
|
|
.addClass('collapsed')
|
|
.children('ul').hide();
|
|
|
|
//Create the button funtionality
|
|
$('#page-nav-expand')
|
|
.unbind('click')
|
|
.click( function() {
|
|
$('.collapsed').addClass('expanded');
|
|
$('.collapsed').children().show('medium');
|
|
|
|
});
|
|
|
|
//FIXME - Collapses too many items, it should leave the primary <li> items visible.
|
|
$('#page-nav-collapse')
|
|
.unbind('click')
|
|
.click( function() {
|
|
$('.collapsed').removeClass('expanded');
|
|
$('.collapsed').children().hide('medium');
|
|
});
|
|
|
|
}
|
|
|
|
|
|
/**************************************************************/
|
|
/* Functions to execute on loading the document */
|
|
/**************************************************************/
|
|
$(document).ready( function()
|
|
{
|
|
pageNavList();
|
|
}); |