aboutsummaryrefslogtreecommitdiff
path: root/javascript
diff options
context:
space:
mode:
Diffstat (limited to 'javascript')
-rw-r--r--javascript/initialise_elgg.js31
1 files changed, 31 insertions, 0 deletions
diff --git a/javascript/initialise_elgg.js b/javascript/initialise_elgg.js
new file mode 100644
index 000000000..d77aaa8ce
--- /dev/null
+++ b/javascript/initialise_elgg.js
@@ -0,0 +1,31 @@
+
+
+$(document).ready(function () {
+
+ // register click function for toggling box contents
+ $('a.toggle_box_contents').bind('click', toggleContent);
+
+ // click function for box contents edit panel
+ $('a.toggle_box_edit_panel').click(function () {
+ $(this.parentNode.parentNode).children("[class=collapsable_box_editpanel]").slideToggle("fast");
+ });
+
+});
+
+// toggle box content
+var toggleContent = function(e) {
+ var targetContent = $('div.collapsable_box_content', this.parentNode.parentNode);
+ if (targetContent.css('display') == 'none') {
+ targetContent.slideDown(400);
+ $(this).html('-');
+ $(this.parentNode).children("[class=toggle_box_edit_panel]").fadeIn('medium');
+
+ } else {
+ targetContent.slideUp(400);
+ $(this).html('+');
+ $(this.parentNode).children("[class=toggle_box_edit_panel]").fadeOut('medium');
+ // make sure edit pane is closed
+ $(this.parentNode.parentNode).children("[class=collapsable_box_editpanel]").hide();
+ }
+ return false;
+};