Subversion Repositories eFlore/Applications.cel

Rev

Rev 3960 | Go to most recent revision | Details | 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
	});
17
};
18
 
19
WidgetPhoto.prototype.initEvts = function() {
20
	const lthis = this;
21
	const $thisGalerie = $( '#cel-photo-contenu' + this.id );
22
	var url   = '',
23
		focus = $( '#print_content' );
24
 
25
	$thisGalerie.on( 'click', 'a.cel-img, a.cel-img-contact', function( event ) {
26
		event.preventDefault();
27
		var lienImage = this.href;
28
 
29
		if ( !/contact/.test( this.className ) ) {
30
			url = '?mode=popup&url_image=' + lienImage + '&galerie_id=' + lthis.galerieId;
31
			url += '&popup_url=' + encodeURIComponent( url );
32
		} else {
33
			url = lienImage;
34
		}
35
		lthis.chargerContenuModale( url );
36
	});
37
	$( '.bouton-plus-filtres', $thisGalerie ).on( 'click', function( event ) {
38
		event.preventDefault();
39
		$( '.autres-filtres, .plus, .moins', $thisGalerie ).toggleClass( 'hidden' );
40
	});
41
	$( '.bouton-fermer-filtres', $thisGalerie ).on( 'click', function( event ) {
42
		event.preventDefault();
43
		$( '.autres-filtres, .bouton-plus-filtres .moins', $thisGalerie ).addClass( 'hidden' );
44
		$( '.bouton-plus-filtres .plus', $thisGalerie ).removeClass( 'hidden' );
45
	});
46
};