Mercurial > hg > MPIWG-drupal-modules
comparison sites/all/modules/custom/solrsearch/solrsearch-mpiwg.js @ 0:015d06b10d37 default tip
initial
author | dwinter |
---|---|
date | Wed, 31 Jul 2013 13:49:13 +0200 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:015d06b10d37 |
---|---|
1 /* | |
2 * Javascript for MPIWG website | |
3 */ | |
4 | |
5 (function ($) { | |
6 $(document).ready(function() { | |
7 /* | |
8 * autosubmit forms | |
9 */ | |
10 $('form.autosubmit').find('.autosubmit').change(function() { | |
11 this.form.submit(); | |
12 }); | |
13 // hide submit button | |
14 $('form.autosubmit input[type="submit"].autosubmit').hide(); | |
15 | |
16 /* | |
17 * foldout divs | |
18 */ | |
19 $('.foldable').each(function() { | |
20 var $this = $(this); | |
21 var $head = $this.find('.fold_head'); | |
22 var $img = $head.find('img'); | |
23 var $body = $this.find('.fold_body'); | |
24 $head.on('click', function() { | |
25 $body.slideToggle('fast'); | |
26 $img.toggle(); | |
27 }).css('cursor', 'pointer'); | |
28 if (! $this.hasClass('initially_open')) { | |
29 // hide body initially | |
30 $body.hide(); | |
31 $img.toggle(); | |
32 } | |
33 }); | |
34 }); | |
35 })(jQuery); |