Subversion Repositories eFlore/Applications.cel

Rev

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

function WidgetPhoto( proprietes ) {
        if  ( this.valOk( proprietes ) ) {
                this.id              = proprietes.id;
                this.galerieId       = proprietes.galerieId;
        }
}

WidgetPhoto.prototype = new WidgetPhotoCommun();

WidgetPhoto.prototype.initTpl = function() {
        $('.grid').masonry({
          itemSelector: '.grid-item',
          columnWidth: '.grid-sizer',
          gutter: 10,
          percentPosition: true
        });

};

WidgetPhoto.prototype.initEvts = function() {
        const lthis = this;
        const $thisGalerie = $( '#cel-photo-contenu' + this.id );
        var url   = '',
                focus = $( '#print_content' );

        $thisGalerie.on( 'click', 'a.cel-img, a.cel-img-contact', function( event ) {
                event.preventDefault();
                var lienImage = this.href;

                if ( !/contact/.test( this.className ) ) {
                        url = '?mode=popup&url_image=' + lienImage + '&galerie_id=' + lthis.galerieId;
                        url += '&popup_url=' + encodeURIComponent( url );
                } else {
                        url = lienImage;
                }
                lthis.chargerContenuModale( url );
        });
        $( '.bouton-plus-filtres', $thisGalerie ).on( 'click', function( event ) {
                event.preventDefault();
                $( '.autres-filtres, .plus, .moins', $thisGalerie ).toggleClass( 'hidden' );
        });
        $( '.bouton-fermer-filtres', $thisGalerie ).on( 'click', function( event ) {
                event.preventDefault();
                $( '.autres-filtres, .bouton-plus-filtres .moins', $thisGalerie ).addClass( 'hidden' );
                $( '.bouton-plus-filtres .plus', $thisGalerie ).removeClass( 'hidden' );
        });
};