1
0
mirror of https://github.com/e107inc/e107.git synced 2025-01-17 20:58:30 +01:00
php-e107/e107_plugins/page/js/jquery.page.navigation.js

47 lines
1.3 KiB
JavaScript
Raw Normal View History

/**************************************************************/
/* Prepares the cv to be dynamically expandable/collapsible */
/**************************************************************/
function pageNavList() {
2015-02-15 02:37:36 -08:00
$('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');
});
2015-02-15 02:37:36 -08:00
}
/**************************************************************/
/* Functions to execute on loading the document */
/**************************************************************/
$(document).ready( function()
{
pageNavList();
});