Mercurial > hg > solrsearch
comparison solrsearch-mpiwg.js @ 0:a2b4f67e73dc default tip
initial
author | Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de> |
---|---|
date | Mon, 08 Jun 2015 10:21:54 +0200 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:a2b4f67e73dc |
---|---|
1 /* | |
2 * Javascript for MPIWG website | |
3 */ | |
4 | |
5 (function ($) { | |
6 $(document).ready(function() { | |
7 /* | |
8 * autosubmit forms | |
9 */ | |
10 | |
11 | |
12 $('form.autosubmit').find('.autosubmit').change(function() { | |
13 this.form.submit(); | |
14 }); | |
15 // hide submit button | |
16 $('form.autosubmit input[type="submit"].autosubmit').hide(); | |
17 | |
18 /* | |
19 * foldout divs | |
20 */ | |
21 $('.foldable').each(function() { | |
22 var $this = $(this); | |
23 var $head = $this.find('.fold_head'); | |
24 var $img = $head.find('img'); | |
25 var $body = $this.find('.fold_body'); | |
26 $head.on('click', function() { | |
27 $body.slideToggle('fast'); | |
28 $img.toggle(); | |
29 }).css('cursor', 'pointer'); | |
30 if (! $this.hasClass('initially_open')) { | |
31 // hide body initially | |
32 $body.hide(); | |
33 $img.toggle(); | |
34 } | |
35 }); | |
36 | |
37 | |
38 /* the following block was uncommented. it was interfering with the code from collapsiblock (M. Trognitz) */ | |
39 /* $('.collapsiblock-processed').each(function() { | |
40 var $this = $(this); | |
41 var $head = $this.children('h2'); | |
42 //var $img = $head.find('img'); | |
43 | |
44 $head.each(function(){ | |
45 var $body = $head.next(); | |
46 | |
47 $(this).on('click', function() { | |
48 $body.slideToggle('fast'); | |
49 //$img.toggle(); | |
50 }).css('cursor', 'pointer'); | |
51 if (! $(this).hasClass('initially_open')) { | |
52 // hide body initially | |
53 $body.hide(); | |
54 //$img.toggle(); | |
55 } | |
56 }); | |
57 });*/ | |
58 | |
59 }); | |
60 })(jQuery); | |
61 |