aboutsummaryrefslogtreecommitdiff
path: root/views/default/navigation/submenu_js.php
blob: 1ed710b2ba94e9b2232f99ddfb2b4684de52c3de (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?php
/**
 * Javascript to expand submenu items.
 *
 * @package Elgg
 * @subpackage Core
 */
?>

<script type="text/javascript">
$(document).ready(function() {
	$('.submenu span.child_indicator').click(function() {
		var submenu = $(this).parent().parent().find('ul.submenu.child:first');
		var closeChild = $($(this).find('.close_child'));
		var openChild = $($(this).find('.open_child'));

		if (submenu.is(':visible')) {
			closeChild.addClass('hidden');
			openChild.removeClass('hidden');
		} else {
			closeChild.removeClass('hidden');
			openChild.addClass('hidden');
		}

		submenu.slideToggle();
		return false;
	});
});
</script>