aboutsummaryrefslogtreecommitdiff
path: root/views/default/navigation/submenu_js.php
blob: 0f0c88888ce831a8507612b43b76dbfa78c18d8c (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
30
31
<?php
/**
 * Javascript to expand submenu items.
 *
 * @package Elgg
 * @subpackage Core
 * @author Curverider Ltd
 * @link http://elgg.org/
 */
?>

<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>