{"version":3,"sources":["../ts/education/device.ts"],"names":["getDevice","window","innerWidth","resizeTrigger","jquery_1","default","trigger","let","resizeTimer","on","clearTimeout","setTimeout"],"mappings":"2GAEA,SAAgBA,YAEd,OAAkB,IADDC,OAAOC,WACA,UAAY,QACtC,CAEA,SAASC,gBACLC,SAAAC,QAAEJ,MAAM,EAAEK,QAAQ,gBAAiB,CAACN,UAAS,EAAG,CACpD,C,gHAEAI,SAAAC,QAAE,WACAF,cAAa,EACbI,IAAIC,YACJJ,SAAAC,QAAEJ,MAAM,EAAEQ,GAAG,SAAU,KACnBC,aAAaF,WAAW,EACxBA,YAAcG,WAAW,WACvBR,cAAa,CACf,EAAG,GAAG,CACV,CAAC,CACH,CAAC","file":"device.js","sourcesContent":["import $ from 'jquery'\r\n\r\nexport function getDevice() {\r\n const viewport = window.innerWidth;\r\n return viewport > 768 ? 'desktop' : 'mobile';\r\n}\r\n\r\nfunction resizeTrigger(){\r\n $(window).trigger('device:change', [getDevice()]);\r\n}\r\n\r\n$(function(){\r\n resizeTrigger();\r\n let resizeTimer:number;\r\n $(window).on('resize', () => {\r\n clearTimeout(resizeTimer);\r\n resizeTimer = setTimeout(function() {\r\n resizeTrigger();\r\n }, 250);\r\n } );\r\n});"]}