mirror of
https://github.com/the-djmaze/snappymail.git
synced 2025-01-09 08:17:53 +08:00
f5a444aa14
Cleanup lightgallery
4 lines
1.5 KiB
JavaScript
4 lines
1.5 KiB
JavaScript
/*! lightgallery - v1.2.21 - 2016-06-28
|
|
* http://sachinchoolur.github.io/lightGallery/
|
|
* Copyright (c) 2016 Sachin N; Licensed Apache 2.0 */
|
|
((e,l)=>{"use strict";var n={fullScreen:!0};e.fn.lightGallery.modules.fullscreen=class{constructor(l){return this.core=e(l).data("lightGallery"),this.$el=e(l),this.core.s=e.extend({},n,this.core.s),this.init(),this}init(){var e="";if(this.core.s.fullScreen){if(!(l.fullscreenEnabled||l.webkitFullscreenEnabled||l.mozFullScreenEnabled||l.msFullscreenEnabled))return;e='<span class="lg-fullscreen lg-icon"></span>',this.core.$outer.find(".lg-toolbar").append(e),this.fullScreen()}}requestFullscreen(){var e=l.documentElement;e.requestFullscreen?e.requestFullscreen():e.msRequestFullscreen?e.msRequestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.webkitRequestFullscreen&&e.webkitRequestFullscreen()}exitFullscreen(){l.exitFullscreen?l.exitFullscreen():l.msExitFullscreen?l.msExitFullscreen():l.mozCancelFullScreen?l.mozCancelFullScreen():l.webkitExitFullscreen&&l.webkitExitFullscreen()}fullScreen(){var n=this;e(l).on("fullscreenchange.lg webkitfullscreenchange.lg mozfullscreenchange.lg MSFullscreenChange.lg",()=>n.core.$outer.toggleClass("lg-fullscreen-on")),this.core.$outer.find(".lg-fullscreen").on("click.lg",()=>{l.fullscreenElement||l.mozFullScreenElement||l.webkitFullscreenElement||l.msFullscreenElement?n.exitFullscreen():n.requestFullscreen()})}destroy(){this.exitFullscreen(),e(l).off("fullscreenchange.lg webkitfullscreenchange.lg mozfullscreenchange.lg MSFullscreenChange.lg")}}})(jQuery,document);
|