1
0
mirror of https://github.com/e107inc/e107.git synced 2025-07-31 03:40:37 +02:00

Expanding Page-Navigation support added. (still a few glitches)

This commit is contained in:
Cameron
2013-11-20 17:44:06 -08:00
parent c27b33963c
commit b0f717e416
6 changed files with 109 additions and 0 deletions

View File

@@ -0,0 +1,47 @@
/**************************************************************/
/* 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();
});