Subversion Repositories eFlore/Applications.eflore-consultation

Rev

Rev 1381 | Rev 1390 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1381 Rev 1389
Line 363... Line 363...
363
	$('.nom').children('.imagettePlus').removeClass('imagettePlus').addClass('imagetteMoins');
363
	$('.nom').children('.imagettePlus').removeClass('imagettePlus').addClass('imagetteMoins');
364
	$('.plus').css('display', 'inline');
364
	$('.plus').css('display', 'inline');
365
}
365
}
Line 366... Line 366...
366
 
366
 
367
function gestionBiblio(parent) {
367
function gestionBiblio(parent) {
-
 
368
	$('.nom').each(function () {
368
	parent.children('.nom').each(function () {
369
		if ($(this).children('.plus').length == 0) {
-
 
370
			html = $(this).html();
-
 
371
			
-
 
372
			// La partie biblio commence au premier crochet ouvrant
369
		html = $(this).html();
373
			// ou bien au span de la biblio à exclure
-
 
374
			posCrochetGauche = html.indexOf('[');
-
 
375
			if(posCrochetGauche < 0) {
-
 
376
				posCrochetGauche = html.indexOf('<span class="bib_excl">');
-
 
377
			}
370
		posCrochetGauche = html.indexOf('[');
378
			
371
		if (posCrochetGauche > 0) {
379
			if (posCrochetGauche > 0) {
372
			nom = html.substr(0, posCrochetGauche);
380
				nom = html.substr(0, posCrochetGauche);
373
			biblio = html.substr(posCrochetGauche, html.length);
381
				biblio = html.substr(posCrochetGauche, html.length);
Line 380... Line 388...
380
			plus = document.createElement('span');
388
				plus = document.createElement('span');
381
			$(plus).addClass('plus');
389
				$(plus).addClass('plus');
382
			$(plus).html(biblio);
390
				$(plus).html(biblio);
383
			$(plus).hide();
391
				$(plus).hide();
Line 384... Line 392...
384
			
392
				
-
 
393
				$(this).click(function(e) {
-
 
394
					// test pour ne réagir que sur le clic sur le + ou -
-
 
395
					// TODO: fusionner ce bout de code en doublon avec synthese.js
385
			$(this).click(function() {
396
					if($(e.target).hasClass("imagettePlus") || $(e.target).hasClass("imagetteMoins")) {
386
				if (!$(this).children('.plus').is(':visible')) {
397
						if (!$(this).children('.plus').is(':visible')) {
387
					$(this).children('.imagettePlus').removeClass('imagettePlus').addClass('imagetteMoins');
398
							$(this).children('.imagettePlus').removeClass('imagettePlus').addClass('imagetteMoins');
388
					$(this).children('.plus').css('display', 'inline');
399
							$(this).children('.plus').css('display', 'inline');
389
				} else {
400
						} else {
390
					$(this).children('.imagetteMoins').removeClass('imagetteMoins').addClass('imagettePlus');
401
							$(this).children('.imagetteMoins').removeClass('imagetteMoins').addClass('imagettePlus');
391
					$(this).children('.plus').css('display', 'none');
402
							$(this).children('.plus').css('display', 'none');
-
 
403
						}
-
 
404
					}
392
				}
405
					
-
 
406
				});
393
			});				
407
					
-
 
408
				$(this).append($(plus));
-
 
409
				
394
			$(this).append($(plus));		
410
			}
395
		}
411
		}
396
	});
412
	});
Line 397... Line 413...
397
}
413
}