From ea14f46429fc6262f3806ecec748f1945a0e6169 Mon Sep 17 00:00:00 2001 From: René 'Necoro' Neumann Date: Mon, 5 Jul 2010 21:02:54 +0200 Subject: Some restructuring --- static/js/show.js | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'static/js/show.js') diff --git a/static/js/show.js b/static/js/show.js index 0c2fd8a..2c43015 100644 --- a/static/js/show.js +++ b/static/js/show.js @@ -1,7 +1,17 @@ $(document).ready(function(){ - $(".details_heading").click(function() { - $(this).next().next().toggle() - }) + $(".detail > .heading").click(function() { + $(this).prevAll(".mark:last").click(); + }); - $(".details").hide() + $(".detail > .mark").toggle( + function() { + this.src = this.src.replace("closed", "open"); + $(this).nextAll(".details:first").toggle(); + }, + function() { + this.src = this.src.replace("open", "closed"); + $(this).nextAll(".details:first").toggle(); + }); + + $(".details").hide(); }) -- cgit v1.2.3-70-g09d2