From dbf6bdbca413b4f2c36be6404162204b5eb5de07 Mon Sep 17 00:00:00 2001 From: pete Date: Wed, 11 Jun 2008 18:23:07 +0000 Subject: 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 --- javascript/initialise_elgg.js | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 javascript/initialise_elgg.js (limited to 'javascript/initialise_elgg.js') 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; +}; -- cgit v1.2.3