aboutsummaryrefslogtreecommitdiff
path: root/views/default/navigation/submenu_js.php
diff options
context:
space:
mode:
Diffstat (limited to 'views/default/navigation/submenu_js.php')
-rw-r--r--views/default/navigation/submenu_js.php31
1 files changed, 31 insertions, 0 deletions
diff --git a/views/default/navigation/submenu_js.php b/views/default/navigation/submenu_js.php
new file mode 100644
index 000000000..0f0c88888
--- /dev/null
+++ b/views/default/navigation/submenu_js.php
@@ -0,0 +1,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> \ No newline at end of file