aboutsummaryrefslogtreecommitdiff
path: root/javascript
diff options
context:
space:
mode:
authorpete <pete@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-06-11 18:23:07 +0000
committerpete <pete@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-06-11 18:23:07 +0000
commitdbf6bdbca413b4f2c36be6404162204b5eb5de07 (patch)
tree2fd872b1af460e5996f805289da8a817a547fc25 /javascript
parent28dda1c699e180d5ff9e091cac92310a3500b786 (diff)
downloadelgg-dbf6bdbca413b4f2c36be6404162204b5eb5de07.tar.gz
elgg-dbf6bdbca413b4f2c36be6404162204b5eb5de07.tar.bz2
new subdirectory added to house the init js for the page - feel free to move elsewhere
git-svn-id: https://code.elgg.org/elgg/trunk@877 36083f99-b078-4883-b0ff-0f9b5a30f544
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;
+};