-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfullscreen.umd.min.js
1 lines (1 loc) · 1.91 KB
/
fullscreen.umd.min.js
1
(function(a,b){if('function'==typeof define&&define.amd)define(['exports'],b);else if('undefined'!=typeof exports)b(exports);else{var c={exports:{}};b(c.exports),a.Fullscreen=c.exports}})(this,function(a){'use strict';function b(a,b){if(!(a instanceof b))throw new TypeError('Cannot call a class as a function')}Object.defineProperty(a,'__esModule',{value:!0});var c=function(){function a(a,b){for(var c,d=0;d<b.length;d++)c=b[d],c.enumerable=c.enumerable||!1,c.configurable=!0,'value'in c&&(c.writable=!0),Object.defineProperty(a,c.key,c)}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),d=function(){for(var a={ms:{element:'msFullscreenElement',enabled:'msFullscreenEnabled',change:'MSFullscreenChange',error:'MSFullscreenError',exit:'msExitFullscreen',request:'msRequestFullscreen'},webkit:{element:'webkitFullscreenElement',enabled:'webkitFullscreenEnabled',change:'webkitfullscreenchange',error:'webkitfullscreenerror',exit:'webkitExitFullscreen',request:'webkitRequestFullScreen'},moz:{element:'mozFullScreenElement',enabled:'mozFullScreenEnabled',change:'mozfullscreenchange',error:'mozfullscreenerror',exit:'mozCancelFullScreen',request:'mozRequestFullScreen'},standard:{element:'fullscreenElement',enabled:'fullscreenEnabled',change:'fullscreenchange',error:'fullscreenerror',exit:'exitFullscreen',request:'requestFullscreen'}},b=['standard','ms','webkit','moz'],c=b.length,d=null,e=0;e<c;e++)if(document[a[b[e]].enabled]){d=a[b[e]];break}return d||{}}(),e=function(){function a(){b(this,a)}return c(a,null,[{key:'on',value:function(a,b){document.addEventListener(d[a],b)}},{key:'off',value:function(a,b){document.removeEventListener(d[a],b)}},{key:'exit',value:function(){document[d.exit].call(document)}},{key:'request',value:function(a){a[d.request].call(a)}},{key:'isEnabled',get:function(){delete a.isEnabled,a.isEnabled=document[d.enabled]}},{key:'isFullscreen',get:function(){return document[d.element]}}]),a}();a.default=e});