view js/mpiwg.js @ 81:975a8d88e315

new editable info blocks for projects. removed RelatedDigitalSources. updateAllProjects converts to info block.
author casties
date Fri, 10 May 2013 17:32:53 +0200
parents 68b3d71eed27
children 04a26a5d3d1d
line wrap: on
line source

/*
 * Javascript for MPIWG website
 */ 

$(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');
		// hide body initially
		$body.hide();
		$img.toggle();
	});
});