@fancyapps/fancybox
Advanced tools
Comparing version 3.5.6 to 3.5.7
{ | ||
"name": "@fancyapps/fancybox", | ||
"description": "Touch enabled, responsive and fully customizable jQuery lightbox script", | ||
"version": "3.5.6", | ||
"version": "3.5.7", | ||
"homepage": "https://fancyapps.com/fancybox/3/", | ||
@@ -51,2 +51,2 @@ "main": "dist/jquery.fancybox.js", | ||
} | ||
} | ||
} |
@@ -7,7 +7,7 @@ // ========================================================================== | ||
// ========================================================================== | ||
(function(document, $) { | ||
(function (document, $) { | ||
"use strict"; | ||
// Collection of methods supported by user browser | ||
var fn = (function() { | ||
var fn = (function () { | ||
var fnMap = [ | ||
@@ -63,3 +63,3 @@ ["requestFullscreen", "exitFullscreen", "fullscreenElement", "fullscreenEnabled", "fullscreenchange", "fullscreenerror"], | ||
var FullScreen = { | ||
request: function(elem) { | ||
request: function (elem) { | ||
elem = elem || document.documentElement; | ||
@@ -69,6 +69,6 @@ | ||
}, | ||
exit: function() { | ||
exit: function () { | ||
document[fn.exitFullscreen](); | ||
}, | ||
toggle: function(elem) { | ||
toggle: function (elem) { | ||
elem = elem || document.documentElement; | ||
@@ -82,6 +82,6 @@ | ||
}, | ||
isFullscreen: function() { | ||
isFullscreen: function () { | ||
return Boolean(document[fn.fullscreenElement]); | ||
}, | ||
enabled: function() { | ||
enabled: function () { | ||
return Boolean(document[fn.fullscreenEnabled]); | ||
@@ -93,4 +93,3 @@ } | ||
btnTpl: { | ||
fullScreen: | ||
'<button data-fancybox-fullscreen class="fancybox-button fancybox-button--fsenter" title="{{FULL_SCREEN}}">' + | ||
fullScreen: '<button data-fancybox-fullscreen class="fancybox-button fancybox-button--fsenter" title="{{FULL_SCREEN}}">' + | ||
'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"/></svg>' + | ||
@@ -105,3 +104,3 @@ '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M5 16h3v3h2v-5H5zm3-8H5v2h5V5H8zm6 11h2v-3h3v-2h-5zm2-11V5h-2v5h5V8z"/></svg>' + | ||
$(document).on(fn.fullscreenchange, function() { | ||
$(document).on(fn.fullscreenchange, function () { | ||
var isFullscreen = FullScreen.isFullscreen(), | ||
@@ -135,3 +134,3 @@ instance = $.fancybox.getInstance(); | ||
$(document).on({ | ||
"onInit.fb": function(e, instance) { | ||
"onInit.fb": function (e, instance) { | ||
var $container; | ||
@@ -148,3 +147,3 @@ | ||
$container.on("click.fb-fullscreen", "[data-fancybox-fullscreen]", function(e) { | ||
$container.on("click.fb-fullscreen", "[data-fancybox-fullscreen]", function (e) { | ||
e.stopPropagation(); | ||
@@ -167,3 +166,3 @@ e.preventDefault(); | ||
"afterKeydown.fb": function(e, instance, current, keypress, keycode) { | ||
"afterKeydown.fb": function (e, instance, current, keypress, keycode) { | ||
// "F" | ||
@@ -177,3 +176,3 @@ if (instance && instance.FullScreen && keycode === 70) { | ||
"beforeClose.fb": function(e, instance) { | ||
"beforeClose.fb": function (e, instance) { | ||
if (instance && instance.FullScreen && instance.$refs.container.hasClass("fancybox-is-fullscreen")) { | ||
@@ -184,2 +183,2 @@ FullScreen.exit(); | ||
}); | ||
})(document, jQuery); | ||
})(document, jQuery); |
@@ -7,6 +7,6 @@ // ========================================================================== | ||
// ========================================================================== | ||
(function(window, document, $) { | ||
(function (window, document, $) { | ||
"use strict"; | ||
var requestAFrame = (function() { | ||
var requestAFrame = (function () { | ||
return ( | ||
@@ -18,3 +18,3 @@ window.requestAnimationFrame || | ||
// if all else fails, use setTimeout | ||
function(callback) { | ||
function (callback) { | ||
return window.setTimeout(callback, 1000 / 60); | ||
@@ -25,3 +25,3 @@ } | ||
var cancelAFrame = (function() { | ||
var cancelAFrame = (function () { | ||
return ( | ||
@@ -32,3 +32,3 @@ window.cancelAnimationFrame || | ||
window.oCancelAnimationFrame || | ||
function(id) { | ||
function (id) { | ||
window.clearTimeout(id); | ||
@@ -39,3 +39,3 @@ } | ||
var getPointerXY = function(e) { | ||
var getPointerXY = function (e) { | ||
var result = []; | ||
@@ -63,3 +63,3 @@ | ||
var distance = function(point2, point1, what) { | ||
var distance = function (point2, point1, what) { | ||
if (!point1 || !point2) { | ||
@@ -78,3 +78,3 @@ return 0; | ||
var isClickable = function($el) { | ||
var isClickable = function ($el) { | ||
if ( | ||
@@ -98,3 +98,3 @@ $el.is('a,area,button,[role="button"],input,label,select,summary,textarea,video,audio,iframe') || | ||
var hasScrollbars = function(el) { | ||
var hasScrollbars = function (el) { | ||
var overflowY = window.getComputedStyle(el)["overflow-y"], | ||
@@ -108,3 +108,3 @@ overflowX = window.getComputedStyle(el)["overflow-x"], | ||
var isScrollable = function($el) { | ||
var isScrollable = function ($el) { | ||
var rez = false; | ||
@@ -129,3 +129,3 @@ | ||
var Guestures = function(instance) { | ||
var Guestures = function (instance) { | ||
var self = this; | ||
@@ -144,3 +144,3 @@ | ||
Guestures.prototype.destroy = function() { | ||
Guestures.prototype.destroy = function () { | ||
var self = this; | ||
@@ -163,3 +163,3 @@ | ||
Guestures.prototype.ontouchstart = function(e) { | ||
Guestures.prototype.ontouchstart = function (e) { | ||
var self = this, | ||
@@ -231,3 +231,6 @@ $target = $(e.target), | ||
self.contentLastPos = null; | ||
self.contentStartPos = $.fancybox.getTranslate(self.$content) || {top: 0, left: 0}; | ||
self.contentStartPos = $.fancybox.getTranslate(self.$content) || { | ||
top: 0, | ||
left: 0 | ||
}; | ||
self.sliderStartPos = $.fancybox.getTranslate($slide); | ||
@@ -304,3 +307,3 @@ | ||
Guestures.prototype.onscroll = function(e) { | ||
Guestures.prototype.onscroll = function (e) { | ||
var self = this; | ||
@@ -313,3 +316,3 @@ | ||
Guestures.prototype.ontouchmove = function(e) { | ||
Guestures.prototype.ontouchmove = function (e) { | ||
var self = this; | ||
@@ -355,3 +358,3 @@ | ||
Guestures.prototype.onSwipe = function(e) { | ||
Guestures.prototype.onSwipe = function (e) { | ||
var self = this, | ||
@@ -390,3 +393,3 @@ instance = self.instance, | ||
$.each(instance.slides, function(index, slide) { | ||
$.each(instance.slides, function (index, slide) { | ||
var slidePos, stagePos; | ||
@@ -406,3 +409,3 @@ | ||
.removeClass("fancybox-animated") | ||
.removeClass(function(index, className) { | ||
.removeClass(function (index, className) { | ||
return (className.match(/(^|\s)fancybox-fx-\S+/g) || []).join(" "); | ||
@@ -460,5 +463,5 @@ }); | ||
self.requestId = requestAFrame(function() { | ||
self.requestId = requestAFrame(function () { | ||
if (self.sliderLastPos) { | ||
$.each(self.instance.slides, function(index, slide) { | ||
$.each(self.instance.slides, function (index, slide) { | ||
var pos = slide.pos - self.instance.currPos; | ||
@@ -477,3 +480,3 @@ | ||
Guestures.prototype.onPan = function() { | ||
Guestures.prototype.onPan = function () { | ||
var self = this; | ||
@@ -495,3 +498,3 @@ | ||
self.requestId = requestAFrame(function() { | ||
self.requestId = requestAFrame(function () { | ||
$.fancybox.setTranslate(self.$content, self.contentLastPos); | ||
@@ -502,3 +505,3 @@ }); | ||
// Make panning sticky to the edges | ||
Guestures.prototype.limitMovement = function() { | ||
Guestures.prototype.limitMovement = function () { | ||
var self = this; | ||
@@ -563,3 +566,3 @@ | ||
Guestures.prototype.limitPosition = function(newOffsetX, newOffsetY, newWidth, newHeight) { | ||
Guestures.prototype.limitPosition = function (newOffsetX, newOffsetY, newWidth, newHeight) { | ||
var self = this; | ||
@@ -592,3 +595,3 @@ | ||
Guestures.prototype.onZoom = function() { | ||
Guestures.prototype.onZoom = function () { | ||
var self = this; | ||
@@ -647,3 +650,3 @@ | ||
self.requestId = requestAFrame(function() { | ||
self.requestId = requestAFrame(function () { | ||
$.fancybox.setTranslate(self.$content, self.contentLastPos); | ||
@@ -653,3 +656,3 @@ }); | ||
Guestures.prototype.ontouchend = function(e) { | ||
Guestures.prototype.ontouchend = function (e) { | ||
var self = this; | ||
@@ -705,3 +708,3 @@ | ||
Guestures.prototype.endSwiping = function(swiping, scrolling) { | ||
Guestures.prototype.endSwiping = function (swiping, scrolling) { | ||
var self = this, | ||
@@ -720,4 +723,3 @@ ret = false, | ||
$.fancybox.animate( | ||
self.instance.current.$slide, | ||
{ | ||
self.instance.current.$slide, { | ||
top: self.sliderStartPos.top + self.distanceY + self.velocityY * 150, | ||
@@ -744,3 +746,3 @@ opacity: 0 | ||
// ======================== | ||
Guestures.prototype.endPanning = function() { | ||
Guestures.prototype.endPanning = function () { | ||
var self = this, | ||
@@ -772,3 +774,3 @@ newOffsetX, | ||
Guestures.prototype.endZooming = function() { | ||
Guestures.prototype.endZooming = function () { | ||
var self = this; | ||
@@ -813,3 +815,3 @@ | ||
Guestures.prototype.onTap = function(e) { | ||
Guestures.prototype.onTap = function (e) { | ||
var self = this; | ||
@@ -828,3 +830,3 @@ var $target = $(e.target); | ||
var process = function(prefix) { | ||
var process = function (prefix) { | ||
var action = current.opts[prefix]; | ||
@@ -898,5 +900,5 @@ | ||
instance.current.$content | ||
.find($target) | ||
.addBack() | ||
.filter($target).length | ||
.find($target) | ||
.addBack() | ||
.filter($target).length | ||
) { | ||
@@ -928,3 +930,3 @@ where = "Content"; | ||
if (current.opts["dblclick" + where] && current.opts["dblclick" + where] !== current.opts["click" + where]) { | ||
self.tapped = setTimeout(function() { | ||
self.tapped = setTimeout(function () { | ||
self.tapped = null; | ||
@@ -945,3 +947,3 @@ | ||
$(document) | ||
.on("onActivate.fb", function(e, instance) { | ||
.on("onActivate.fb", function (e, instance) { | ||
if (instance && !instance.Guestures) { | ||
@@ -951,3 +953,3 @@ instance.Guestures = new Guestures(instance); | ||
}) | ||
.on("beforeClose.fb", function(e, instance) { | ||
.on("beforeClose.fb", function (e, instance) { | ||
if (instance && instance.Guestures) { | ||
@@ -957,2 +959,2 @@ instance.Guestures.destroy(); | ||
}); | ||
})(window, document, jQuery); | ||
})(window, document, jQuery); |
@@ -7,3 +7,3 @@ // ========================================================================== | ||
// ========================================================================== | ||
(function(window, document, $) { | ||
(function (window, document, $) { | ||
"use strict"; | ||
@@ -13,5 +13,5 @@ | ||
if (!$.escapeSelector) { | ||
$.escapeSelector = function(sel) { | ||
$.escapeSelector = function (sel) { | ||
var rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g; | ||
var fcssescape = function(ch, asCodePoint) { | ||
var fcssescape = function (ch, asCodePoint) { | ||
if (asCodePoint) { | ||
@@ -77,3 +77,3 @@ // U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER | ||
// Start when DOM becomes ready | ||
$(function() { | ||
$(function () { | ||
// Check if user has disabled this module | ||
@@ -86,3 +86,3 @@ if ($.fancybox.defaults.hash === false) { | ||
$(document).on({ | ||
"onInit.fb": function(e, instance) { | ||
"onInit.fb": function (e, instance) { | ||
var url, gallery; | ||
@@ -103,3 +103,3 @@ | ||
"beforeShow.fb": function(e, instance, current, firstRun) { | ||
"beforeShow.fb": function (e, instance, current, firstRun) { | ||
var gallery; | ||
@@ -136,6 +136,5 @@ | ||
// Update hash | ||
instance.hashTimer = setTimeout(function() { | ||
instance.hashTimer = setTimeout(function () { | ||
if ("replaceState" in window.history) { | ||
window.history[firstRun ? "pushState" : "replaceState"]( | ||
{}, | ||
window.history[firstRun ? "pushState" : "replaceState"]({}, | ||
document.title, | ||
@@ -156,3 +155,3 @@ window.location.pathname + window.location.search + "#" + instance.currentHash | ||
"beforeClose.fb": function(e, instance, current) { | ||
"beforeClose.fb": function (e, instance, current) { | ||
if (!current || current.opts.hash === false) { | ||
@@ -180,3 +179,3 @@ return; | ||
// Check if need to start/close after url has changed | ||
$(window).on("hashchange.fb", function() { | ||
$(window).on("hashchange.fb", function () { | ||
var url = parseUrl(), | ||
@@ -188,5 +187,5 @@ fb = null; | ||
$(".fancybox-container") | ||
.get() | ||
.reverse(), | ||
function(index, value) { | ||
.get() | ||
.reverse(), | ||
function (index, value) { | ||
var tmp = $(value).data("FancyBox"); | ||
@@ -214,3 +213,3 @@ | ||
// Check current hash and trigger click event on matching element to start fancyBox, if needed | ||
setTimeout(function() { | ||
setTimeout(function () { | ||
if (!$.fancybox.getInstance()) { | ||
@@ -221,2 +220,2 @@ triggerFromUrl(parseUrl()); | ||
}); | ||
})(window, document, jQuery); | ||
})(window, document, jQuery); |
@@ -7,3 +7,3 @@ // ========================================================================== | ||
// ========================================================================== | ||
(function($) { | ||
(function ($) { | ||
"use strict"; | ||
@@ -60,3 +60,3 @@ | ||
type: "iframe", | ||
url: function(rez) { | ||
url: function (rez) { | ||
return ( | ||
@@ -80,3 +80,3 @@ "//maps.google." + | ||
type: "iframe", | ||
url: function(rez) { | ||
url: function (rez) { | ||
return "//maps.google." + rez[2] + "/maps?q=" + rez[5].replace("query=", "q=").replace("api=1", "") + "&output=embed"; | ||
@@ -88,3 +88,3 @@ } | ||
// Formats matching url to final form | ||
var format = function(url, rez, params) { | ||
var format = function (url, rez, params) { | ||
if (!url) { | ||
@@ -100,3 +100,3 @@ return; | ||
$.each(rez, function(key, value) { | ||
$.each(rez, function (key, value) { | ||
url = url.replace("$" + key, value || ""); | ||
@@ -112,3 +112,3 @@ }); | ||
$(document).on("objectNeedsType.fb", function(e, instance, item) { | ||
$(document).on("objectNeedsType.fb", function (e, instance, item) { | ||
var url = item.src || "", | ||
@@ -127,3 +127,3 @@ type = false, | ||
// Look for any matching media type | ||
$.each(media, function(providerName, providerOpts) { | ||
$.each(media, function (providerName, providerOpts) { | ||
rez = url.match(providerOpts.matcher); | ||
@@ -166,3 +166,3 @@ | ||
if (providerName === "youtube") { | ||
url = url.replace(/&t=((\d+)m)?(\d+)s/, function(match, p1, m, s) { | ||
url = url.replace(/&t=((\d+)m)?(\d+)s/, function (match, p1, m, s) { | ||
return "&start=" + ((m ? parseInt(m, 10) * 60 : 0) + parseInt(s, 10)); | ||
@@ -223,3 +223,3 @@ }); | ||
load: function(vendor) { | ||
load: function (vendor) { | ||
var _this = this, | ||
@@ -229,3 +229,3 @@ script; | ||
if (this[vendor].loaded) { | ||
setTimeout(function() { | ||
setTimeout(function () { | ||
_this.done(vendor); | ||
@@ -247,3 +247,3 @@ }); | ||
if (vendor === "youtube") { | ||
window.onYouTubeIframeAPIReady = function() { | ||
window.onYouTubeIframeAPIReady = function () { | ||
_this[vendor].loaded = true; | ||
@@ -253,3 +253,3 @@ _this.done(vendor); | ||
} else { | ||
script.onload = function() { | ||
script.onload = function () { | ||
_this[vendor].loaded = true; | ||
@@ -262,3 +262,3 @@ _this.done(vendor); | ||
}, | ||
done: function(vendor) { | ||
done: function (vendor) { | ||
var instance, $el, player; | ||
@@ -278,3 +278,3 @@ | ||
events: { | ||
onStateChange: function(e) { | ||
onStateChange: function (e) { | ||
if (e.data == 0) { | ||
@@ -289,3 +289,3 @@ instance.next(); | ||
player.on("ended", function() { | ||
player.on("ended", function () { | ||
instance.next(); | ||
@@ -299,3 +299,3 @@ }); | ||
$(document).on({ | ||
"afterShow.fb": function(e, instance, current) { | ||
"afterShow.fb": function (e, instance, current) { | ||
if (instance.group.length > 1 && (current.contentSource === "youtube" || current.contentSource === "vimeo")) { | ||
@@ -306,2 +306,2 @@ VideoAPILoader.load(current.contentSource); | ||
}); | ||
})(jQuery); | ||
})(jQuery); |
@@ -7,3 +7,3 @@ //// ========================================================================== | ||
// ========================================================================== | ||
(function(document, $) { | ||
(function (document, $) { | ||
"use strict"; | ||
@@ -13,4 +13,3 @@ | ||
btnTpl: { | ||
share: | ||
'<button data-fancybox-share class="fancybox-button fancybox-button--share" title="{{SHARE}}">' + | ||
share: '<button data-fancybox-share class="fancybox-button fancybox-button--share" title="{{SHARE}}">' + | ||
'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M2.55 19c1.4-8.4 9.1-9.8 11.9-9.8V5l7 7-7 6.3v-3.5c-2.8 0-10.5 2.1-11.9 4.2z"/></svg>' + | ||
@@ -20,3 +19,3 @@ "</button>" | ||
share: { | ||
url: function(instance, item) { | ||
url: function (instance, item) { | ||
return ( | ||
@@ -26,4 +25,3 @@ (!instance.currentHash && !(item.type === "inline" || item.type === "html") ? item.origSrc || item.src : false) || window.location | ||
}, | ||
tpl: | ||
'<div class="fancybox-share">' + | ||
tpl: '<div class="fancybox-share">' + | ||
"<h1>{{SHARE}}</h1>" + | ||
@@ -61,3 +59,3 @@ "<p>" + | ||
return String(string).replace(/[&<>"'`=\/]/g, function(s) { | ||
return String(string).replace(/[&<>"'`=\/]/g, function (s) { | ||
return entityMap[s]; | ||
@@ -67,3 +65,3 @@ }); | ||
$(document).on("click", "[data-fancybox-share]", function() { | ||
$(document).on("click", "[data-fancybox-share]", function () { | ||
var instance = $.fancybox.getInstance(), | ||
@@ -94,5 +92,5 @@ current = instance.current || null, | ||
animationEffect: false, | ||
afterLoad: function(shareInstance, shareCurrent) { | ||
afterLoad: function (shareInstance, shareCurrent) { | ||
// Close self if parent instance is closing | ||
instance.$refs.container.one("beforeClose.fb", function() { | ||
instance.$refs.container.one("beforeClose.fb", function () { | ||
shareInstance.close(null, 0); | ||
@@ -102,3 +100,3 @@ }); | ||
// Opening links in a popup window | ||
shareCurrent.$content.find(".fancybox-share__button").click(function() { | ||
shareCurrent.$content.find(".fancybox-share__button").click(function () { | ||
window.open(this.href, "Share", "width=550, height=450"); | ||
@@ -114,2 +112,2 @@ return false; | ||
}); | ||
})(document, jQuery); | ||
})(document, jQuery); |
@@ -10,3 +10,3 @@ // ========================================================================== | ||
// ========================================================================== | ||
(function(document, $) { | ||
(function (document, $) { | ||
"use strict"; | ||
@@ -16,4 +16,3 @@ | ||
btnTpl: { | ||
slideShow: | ||
'<button data-fancybox-play class="fancybox-button fancybox-button--play" title="{{PLAY_START}}">' + | ||
slideShow: '<button data-fancybox-play class="fancybox-button fancybox-button--play" title="{{PLAY_START}}">' + | ||
'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M6.5 5.4v13.2l11-6.6z"/></svg>' + | ||
@@ -30,3 +29,3 @@ '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M8.33 5.75h2.2v12.5h-2.2V5.75zm5.15 0h2.2v12.5h-2.2V5.75z"/></svg>' + | ||
var SlideShow = function(instance) { | ||
var SlideShow = function (instance) { | ||
this.instance = instance; | ||
@@ -41,3 +40,3 @@ this.init(); | ||
init: function() { | ||
init: function () { | ||
var self = this, | ||
@@ -47,3 +46,3 @@ instance = self.instance, | ||
self.$button = instance.$refs.toolbar.find("[data-fancybox-play]").on("click", function() { | ||
self.$button = instance.$refs.toolbar.find("[data-fancybox-play]").on("click", function () { | ||
self.toggle(); | ||
@@ -59,3 +58,3 @@ }); | ||
set: function(force) { | ||
set: function (force) { | ||
var self = this, | ||
@@ -69,6 +68,8 @@ instance = self.instance, | ||
if (self.$progress) { | ||
$.fancybox.animate(self.$progress.show(), {scaleX: 1}, current.opts.slideShow.speed); | ||
$.fancybox.animate(self.$progress.show(), { | ||
scaleX: 1 | ||
}, current.opts.slideShow.speed); | ||
} | ||
self.timer = setTimeout(function() { | ||
self.timer = setTimeout(function () { | ||
if (!instance.current.opts.loop && instance.current.index == instance.group.length - 1) { | ||
@@ -88,3 +89,3 @@ instance.jumpTo(0); | ||
clear: function() { | ||
clear: function () { | ||
var self = this; | ||
@@ -101,3 +102,3 @@ | ||
start: function() { | ||
start: function () { | ||
var self = this, | ||
@@ -122,3 +123,3 @@ current = self.instance.current; | ||
stop: function() { | ||
stop: function () { | ||
var self = this, | ||
@@ -143,3 +144,3 @@ current = self.instance.current; | ||
toggle: function() { | ||
toggle: function () { | ||
var self = this; | ||
@@ -156,3 +157,3 @@ | ||
$(document).on({ | ||
"onInit.fb": function(e, instance) { | ||
"onInit.fb": function (e, instance) { | ||
if (instance && !instance.SlideShow) { | ||
@@ -163,3 +164,3 @@ instance.SlideShow = new SlideShow(instance); | ||
"beforeShow.fb": function(e, instance, current, firstRun) { | ||
"beforeShow.fb": function (e, instance, current, firstRun) { | ||
var SlideShow = instance && instance.SlideShow; | ||
@@ -176,3 +177,3 @@ | ||
"afterShow.fb": function(e, instance, current) { | ||
"afterShow.fb": function (e, instance, current) { | ||
var SlideShow = instance && instance.SlideShow; | ||
@@ -185,3 +186,3 @@ | ||
"afterKeydown.fb": function(e, instance, current, keypress, keycode) { | ||
"afterKeydown.fb": function (e, instance, current, keypress, keycode) { | ||
var SlideShow = instance && instance.SlideShow; | ||
@@ -197,3 +198,3 @@ | ||
"beforeClose.fb onDeactivate.fb": function(e, instance) { | ||
"beforeClose.fb onDeactivate.fb": function (e, instance) { | ||
var SlideShow = instance && instance.SlideShow; | ||
@@ -208,3 +209,3 @@ | ||
// Page Visibility API to pause slideshow when window is not active | ||
$(document).on("visibilitychange", function() { | ||
$(document).on("visibilitychange", function () { | ||
var instance = $.fancybox.getInstance(), | ||
@@ -221,2 +222,2 @@ SlideShow = instance && instance.SlideShow; | ||
}); | ||
})(document, jQuery); | ||
})(document, jQuery); |
@@ -7,3 +7,3 @@ // ========================================================================== | ||
// ========================================================================== | ||
(function(document, $) { | ||
(function (document, $) { | ||
"use strict"; | ||
@@ -16,7 +16,5 @@ | ||
$.fancybox.defaults = $.extend( | ||
true, | ||
{ | ||
true, { | ||
btnTpl: { | ||
thumbs: | ||
'<button data-fancybox-thumbs class="fancybox-button fancybox-button--thumbs" title="{{THUMBS}}">' + | ||
thumbs: '<button data-fancybox-thumbs class="fancybox-button fancybox-button--thumbs" title="{{THUMBS}}">' + | ||
'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M14.59 14.59h3.76v3.76h-3.76v-3.76zm-4.47 0h3.76v3.76h-3.76v-3.76zm-4.47 0h3.76v3.76H5.65v-3.76zm8.94-4.47h3.76v3.76h-3.76v-3.76zm-4.47 0h3.76v3.76h-3.76v-3.76zm-4.47 0h3.76v3.76H5.65v-3.76zm8.94-4.47h3.76v3.76h-3.76V5.65zm-4.47 0h3.76v3.76h-3.76V5.65zm-4.47 0h3.76v3.76H5.65V5.65z"/></svg>' + | ||
@@ -35,3 +33,3 @@ "</button>" | ||
var FancyThumbs = function(instance) { | ||
var FancyThumbs = function (instance) { | ||
this.init(instance); | ||
@@ -47,3 +45,3 @@ }; | ||
init: function(instance) { | ||
init: function (instance) { | ||
var self = this, | ||
@@ -72,3 +70,3 @@ group = instance.group, | ||
if (enabled > 1 && !!self.opts) { | ||
self.$button.removeAttr("style").on("click", function() { | ||
self.$button.removeAttr("style").on("click", function () { | ||
self.toggle(); | ||
@@ -83,3 +81,3 @@ }); | ||
create: function() { | ||
create: function () { | ||
var self = this, | ||
@@ -95,9 +93,9 @@ instance = self.instance, | ||
instance.$refs.container | ||
.find(parentEl) | ||
.addBack() | ||
.filter(parentEl) | ||
.find(parentEl) | ||
.addBack() | ||
.filter(parentEl) | ||
); | ||
// Add "click" event that performs gallery navigation | ||
self.$grid.on("click", "a", function() { | ||
self.$grid.on("click", "a", function () { | ||
instance.jumpTo($(this).attr("data-index")); | ||
@@ -112,3 +110,3 @@ }); | ||
$.each(instance.group, function(i, item) { | ||
$.each(instance.group, function (i, item) { | ||
src = item.thumb; | ||
@@ -122,6 +120,6 @@ | ||
'<a href="javascript:;" tabindex="0" data-index="' + | ||
i + | ||
'"' + | ||
(src && src.length ? ' style="background-image:url(' + src + ')"' : 'class="fancybox-thumbs-missing"') + | ||
"></a>" | ||
i + | ||
'"' + | ||
(src && src.length ? ' style="background-image:url(' + src + ')"' : 'class="fancybox-thumbs-missing"') + | ||
"></a>" | ||
); | ||
@@ -136,7 +134,7 @@ }); | ||
parseInt(self.$grid.css("padding-right"), 10) + | ||
instance.group.length * | ||
self.$list | ||
.children() | ||
.eq(0) | ||
.outerWidth(true) | ||
instance.group.length * | ||
self.$list | ||
.children() | ||
.eq(0) | ||
.outerWidth(true) | ||
); | ||
@@ -146,3 +144,3 @@ } | ||
focus: function(duration) { | ||
focus: function (duration) { | ||
var self = this, | ||
@@ -168,4 +166,3 @@ $list = self.$list, | ||
if (self.opts.axis === "y" && (thumbPos.top < 0 || thumbPos.top > $list.height() - thumb.outerHeight())) { | ||
$list.stop().animate( | ||
{ | ||
$list.stop().animate({ | ||
scrollTop: $list.scrollTop() + thumbPos.top | ||
@@ -182,4 +179,3 @@ }, | ||
.stop() | ||
.animate( | ||
{ | ||
.animate({ | ||
scrollLeft: thumbPos.left | ||
@@ -192,3 +188,3 @@ }, | ||
update: function() { | ||
update: function () { | ||
var that = this; | ||
@@ -213,3 +209,3 @@ that.instance.$refs.container.toggleClass("fancybox-show-thumbs", this.isVisible); | ||
hide: function() { | ||
hide: function () { | ||
this.isVisible = false; | ||
@@ -219,3 +215,3 @@ this.update(); | ||
show: function() { | ||
show: function () { | ||
this.isVisible = true; | ||
@@ -225,3 +221,3 @@ this.update(); | ||
toggle: function() { | ||
toggle: function () { | ||
this.isVisible = !this.isVisible; | ||
@@ -233,3 +229,3 @@ this.update(); | ||
$(document).on({ | ||
"onInit.fb": function(e, instance) { | ||
"onInit.fb": function (e, instance) { | ||
var Thumbs; | ||
@@ -246,3 +242,3 @@ | ||
"beforeShow.fb": function(e, instance, item, firstRun) { | ||
"beforeShow.fb": function (e, instance, item, firstRun) { | ||
var Thumbs = instance && instance.Thumbs; | ||
@@ -255,3 +251,3 @@ | ||
"afterKeydown.fb": function(e, instance, current, keypress, keycode) { | ||
"afterKeydown.fb": function (e, instance, current, keypress, keycode) { | ||
var Thumbs = instance && instance.Thumbs; | ||
@@ -267,3 +263,3 @@ | ||
"beforeClose.fb": function(e, instance) { | ||
"beforeClose.fb": function (e, instance) { | ||
var Thumbs = instance && instance.Thumbs; | ||
@@ -276,2 +272,2 @@ | ||
}); | ||
})(document, jQuery); | ||
})(document, jQuery); |
@@ -7,3 +7,3 @@ // ========================================================================== | ||
// ========================================================================== | ||
(function(document, $) { | ||
(function (document, $) { | ||
"use strict"; | ||
@@ -14,4 +14,4 @@ | ||
$(document).on({ | ||
"onInit.fb": function(e, instance, current) { | ||
instance.$refs.stage.on("mousewheel DOMMouseScroll wheel MozMousePixelScroll", function(e) { | ||
"onInit.fb": function (e, instance, current) { | ||
instance.$refs.stage.on("mousewheel DOMMouseScroll wheel MozMousePixelScroll", function (e) { | ||
var current = instance.current, | ||
@@ -43,2 +43,2 @@ currTime = new Date().getTime(); | ||
}); | ||
})(document, jQuery); | ||
})(document, jQuery); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
525869
10758