Mercurial > hg > MPIWG-drupal-modules
diff 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 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sites/all/modules/custom/solrsearch/solrsearch-mpiwg.js Wed Jul 31 13:49:13 2013 +0200 @@ -0,0 +1,35 @@ +/* + * Javascript for MPIWG website + */ + +(function ($) { +$(document).ready(function() { + /* + * autosubmit forms + */ + $('form.autosubmit').find('.autosubmit').change(function() { + this.form.submit(); + }); + // hide submit button + $('form.autosubmit input[type="submit"].autosubmit').hide(); + + /* + * foldout divs + */ + $('.foldable').each(function() { + var $this = $(this); + var $head = $this.find('.fold_head'); + var $img = $head.find('img'); + var $body = $this.find('.fold_body'); + $head.on('click', function() { + $body.slideToggle('fast'); + $img.toggle(); + }).css('cursor', 'pointer'); + if (! $this.hasClass('initially_open')) { + // hide body initially + $body.hide(); + $img.toggle(); + } + }); +}); +})(jQuery); \ No newline at end of file