web-aid-kit / ngx-image-gallery

Probably the best Angular 4+ modal and inline image gallery. Angular upgrade for ng-image-gallery.
79 stars 47 forks source link

Close gallery on backdrop click (outside of image) when gallery is fullscreen. #17

Open cangec opened 6 years ago

cangec commented 6 years ago

Hey. Is It possible to close the gallery on backdrop click when the gallery is full screen?

thatisuday commented 6 years ago

@cangec This is possible in case of social media dialog post where only close button lies outside a bounding box. Since this gallery takes entire screen area and many things are outside image area which are important to interact with, I am not sure whether we can add this feature at this moment.

kappi94 commented 6 years ago

this.elementRef.nativeElement.querySelector('#ngx-gallery').addEventListener('click', e => { if(!(e.target.closest('img')) && !(e.target.closest('.control')) && !(e.target.closest('.thumbnail'))){ this.closeGallery(); } });

This worked for me. I gave the gallery an id of 'ngx-gallery' to select it easier.

Samhot commented 5 years ago

Hi ! Any news about this functionality ?