{"version":3,"file":"/pc/all/libs/lightbox/viewer.js.map","sources":["/pc/all/libs/lightbox/viewer.js"],"sourcesContent":["/* global define */\r\n\r\n// TODO: external controls like carousel?\r\n// TODO: Add swipe next/previous when zoomed out?\r\n\r\n(function(factory) {\r\n if (typeof define === \"function\" && define.amd) {\r\n define([\r\n \"jquery\",\r\n \"./core\",\r\n \"./transition\"\r\n ], factory);\r\n } else {\r\n factory(jQuery, Formstone);\r\n }\r\n }(function($, Formstone) {\r\n\r\n \"use strict\";\r\n\r\n /**\r\n * @method private\r\n * @name setup\r\n * @description Setup plugin.\r\n */\r\n\r\n function setup() {\r\n scroll();\r\n $Window.on(\"scroll\", scroll);\r\n $Body = Formstone.$body;\r\n }\r\n\r\n /**\r\n * @method private\r\n * @name resize\r\n * @description Handles window resize\r\n */\r\n\r\n function resize() {\r\n Functions.iterate.call($Instances, resizeInstance);\r\n // Functions.iterate.call($LazyInstances, cacheScrollPosition);\r\n // Functions.iterate.call($LazyInstances, checkScrollPosition);\r\n }\r\n\r\n /**\r\n * @method private\r\n * @name scroll\r\n * @description Handles window scroll\r\n */\r\n\r\n function scroll() {\r\n ScrollTop = $Window.scrollTop() + Formstone.windowHeight;\r\n\r\n if (ScrollTop < 0) {\r\n ScrollTop = 0;\r\n }\r\n\r\n // Functions.iterate.call($LazyInstances, checkScrollPosition);\r\n }\r\n\r\n /**\r\n * @method private\r\n * @name raf\r\n * @description Handles request animation frame\r\n */\r\n\r\n function raf() {\r\n Functions.iterate.call($Instances, renderRAF);\r\n }\r\n\r\n /**\r\n * @method private\r\n * @name cacheInstances\r\n * @description Caches active instances\r\n */\r\n\r\n function cacheInstances() {\r\n $Instances = $(Classes.base);\r\n // $LazyInstances = $(Classes.lazy);\r\n\r\n // Functions.iterate.call($LazyInstances, cacheScrollPosition);\r\n\r\n if ($Instances.length) {\r\n Functions.lockViewport(Namespace);\r\n } else {\r\n Functions.unlockViewport(Namespace);\r\n }\r\n }\r\n\r\n /**\r\n * @method private\r\n * @name construct\r\n * @description Builds instance.\r\n * @param data [object] \"Instance data\"\r\n */\r\n\r\n function construct(data) {\r\n var $image,\r\n imageData,\r\n html = '',\r\n controlPrevClasses = [RawClasses.control, RawClasses.control_previous].join(\" \"),\r\n controlNextClasses = [RawClasses.control, RawClasses.control_next].join(\" \"),\r\n controlZoomInClasses = [RawClasses.control, RawClasses.control_zoom_in].join(\" \"),\r\n controlZoomOutClasses = [RawClasses.control, RawClasses.control_zoom_out].join(\" \");\r\n\r\n data.thisClasses = [RawClasses.base, RawClasses.loading, data.customClass, data.theme];\r\n data.images = [];\r\n data.source = false;\r\n data.gallery = false;\r\n data.tapTimer = null;\r\n data.action = false;\r\n data.isRendering = false;\r\n data.isZooming = false;\r\n data.isAnimating = false;\r\n\r\n data.keyDownTime = 1;\r\n\r\n data.$images = this.find(\"img\").addClass(RawClasses.source);\r\n data.index = 0;\r\n data.total = data.$images.length - 1;\r\n\r\n // Check custom controls\r\n data.customControls = ($.type(data.controls) === \"object\" && data.controls.zoom_in && data.controls.zoom_out);\r\n\r\n if (data.$images.length > 1) {\r\n data.gallery = true;\r\n data.thisClasses.push(RawClasses.gallery);\r\n\r\n // Requie zoom for gallery custom controls\r\n if (data.customControls && (!data.controls.previous || !data.controls.next)) {\r\n data.customControls = false;\r\n }\r\n }\r\n\r\n for (var i = 0; i < data.$images.length; i++) {\r\n $image = data.$images.eq(i);\r\n data.images.push($image.attr(\"src\"));\r\n }\r\n\r\n html += '