Subversion Repositories eFlore/Applications.cel

Rev

Rev 3631 | Rev 3960 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
3631 idir 1
function WidgetPhoto( proprietes ) {
2
	if  ( this.valOk( proprietes ) ) {
3
		this.id              = proprietes.id;
4
		this.galerieId       = proprietes.galerieId;
5
	}
6
}
7
 
8
WidgetPhoto.prototype = new WidgetPhotoCommun();
9
 
10
WidgetPhoto.prototype.initTpl = function() {
11
	$('.grid').masonry({
12
	  itemSelector: '.grid-item',
13
	  columnWidth: '.grid-sizer',
14
	  gutter: 10,
15
	  percentPosition: true
16
	});
3829 idir 17
 
3631 idir 18
};
19
 
20
WidgetPhoto.prototype.initEvts = function() {
21
	const lthis = this;
22
	const $thisGalerie = $( '#cel-photo-contenu' + this.id );
23
	var url   = '',
24
		focus = $( '#print_content' );
25
 
26
	$thisGalerie.on( 'click', 'a.cel-img, a.cel-img-contact', function( event ) {
27
		event.preventDefault();
28
		var lienImage = this.href;
29
 
30
		if ( !/contact/.test( this.className ) ) {
31
			url = '?mode=popup&url_image=' + lienImage + '&galerie_id=' + lthis.galerieId;
32
			url += '&popup_url=' + encodeURIComponent( url );
33
		} else {
34
			url = lienImage;
35
		}
36
		lthis.chargerContenuModale( url );
37
	});
38
	$( '.bouton-plus-filtres', $thisGalerie ).on( 'click', function( event ) {
39
		event.preventDefault();
40
		$( '.autres-filtres, .plus, .moins', $thisGalerie ).toggleClass( 'hidden' );
41
	});
42
	$( '.bouton-fermer-filtres', $thisGalerie ).on( 'click', function( event ) {
43
		event.preventDefault();
44
		$( '.autres-filtres, .bouton-plus-filtres .moins', $thisGalerie ).addClass( 'hidden' );
45
		$( '.bouton-plus-filtres .plus', $thisGalerie ).removeClass( 'hidden' );
46
	});
47
};