Subversion Repositories Sites.obs-saisons.fr

Rev

Rev 31 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 31 Rev 39
1
function initialiserElementsPliables() {
1
function initialiserElementsPliables() {
2
 
2
 
3
	$('.pliage h4').addClass('lien_pliage');
3
	$('.pliage h4').addClass('lien_pliage');
4
 
4
 
5
	$('.pliage ul').hide();
5
	$('.pliage ul').hide();
6
	$('.pliage > ul:first-child').hide();
6
	$('.pliage > ul:first-child').hide();
7
 
7
 
8
	$('.pliage').bind('click', function() {
8
	$('.pliage').bind('click', function() {
9
		
9
		
10
		$(this).children('ul').slideToggle();
10
		$(this).children('ul').slideToggle();
11
		return false;
11
		return false;
12
	});
12
	});
13
}
13
}
14
 
14
 
15
function initialiserLignesCliquables() {
15
function initialiserLignesCliquables() {
16
	
16
	
-
 
17
	$(".observations_individu").each(function() {
17
	$('.observations_individu').bind('click', function() {
18
		$(this).bind('click', function() {
18
		
19
			
19
		//$(this).children('td a').click();
20
			// pour le moment un clic sur la ligne envoie sur la page d'édition
20
		window.alert($(this).children('td').attr('href'));
21
			// TODO: faire une modification en ajax
21
		//window.location = $(this).children('td a').attr('href');
22
			window.location = $(this).find("a.lien_modifier").attr('href');
22
		
23
			
-
 
24
			return false;
23
		return false;
25
		});
24
	});
26
	});
25
	
27
	
26
}
28
}
27
 
29
 
28
$(document).ready(function() {
30
$(document).ready(function() {
29
	initialiserElementsPliables();
31
	initialiserElementsPliables();
30
	initialiserLignesCliquables();
32
	initialiserLignesCliquables();
31
});
33
});