`);\r\n\t\t\tthis._resize(width, height);\r\n\t\t\tthis._config.onContentLoaded.call(this);\r\n\t\t\tif (this._$modalArrows)\r\n\t\t\t\tthis._$modalArrows.css('display', 'none'); //hide the arrows when showing video\r\n\t\t\tthis._toggleLoading(false);\r\n\t\t\treturn this;\r\n\t\t}\r\n\r\n\t\t_loadRemoteContent(url, $containerForElement) {\r\n\t\t\tlet width = this._$element.data('width') || 560;\r\n\t\t\tlet height = this._$element.data('height') || 560;\r\n\r\n\t\t\tlet disableExternalCheck = this._$element.data('disableExternalCheck') || false;\r\n\t\t\tthis._toggleLoading(false);\r\n\r\n\t\t\t// external urls are loading into an iframe\r\n\t\t\t// local ajax can be loaded into the container itself\r\n\t\t\tif (!disableExternalCheck && !this._isExternal(url)) {\r\n\t\t\t\t$containerForElement.load(url, $.proxy(() => {\r\n\t\t\t\t\treturn this._$element.trigger('loaded.bs.modal');\r\n\t\t\t\t}));\r\n\r\n\t\t\t} else {\r\n\t\t\t\t$containerForElement.html(``);\r\n\t\t\t\tthis._config.onContentLoaded.call(this);\r\n\t\t\t}\r\n\r\n\t\t\tif (this._$modalArrows) //hide the arrows when remote content\r\n\t\t\t\tthis._$modalArrows.css('display', 'none')\r\n\r\n\t\t\tthis._resize(width, height);\r\n\t\t\treturn this;\r\n\t\t}\r\n\r\n\t\t_isExternal(url) {\r\n\t\t\tlet match = url.match(/^([^:\\/?#]+:)?(?:\\/\\/([^\\/?#]*))?([^?#]+)?(\\?[^#]*)?(#.*)?/);\r\n\t\t\tif (typeof match[1] === \"string\" && match[1].length > 0 && match[1].toLowerCase() !== location.protocol)\r\n\t\t\t\treturn true;\r\n\r\n\t\t\tif (typeof match[2] === \"string\" && match[2].length > 0 && match[2].replace(new RegExp(`:(${{\r\n\t\t\t\t\t\"http:\": 80,\r\n\t\t\t\t\t\"https:\": 443\r\n\t\t\t\t}[location.protocol]})?$`), \"\") !== location.host)\r\n\t\t\t\treturn true;\r\n\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t_error( message ) {\r\n\t\t\tconsole.error(message);\r\n\t\t\tthis._containerToUse().html(message);\r\n\t\t\tthis._resize(300, 300);\r\n\t\t\treturn this;\r\n\t\t}\r\n\r\n\t\t_preloadImageByIndex(startIndex, numberOfTimes) {\r\n\r\n\t\t\tif(!this._$galleryItems)\r\n\t\t\t\treturn;\r\n\r\n\t\t\tlet next = $(this._$galleryItems.get(startIndex), false)\r\n\t\t\tif(typeof next == 'undefined')\r\n\t\t\t\treturn\r\n\r\n\t\t\tlet src = this._getSource(next)\r\n\t\t\tif (next.attr('data-type') === 'image' || this._isImage(src))\r\n\t\t\t\tthis._preloadImage(src, false)\r\n\r\n\t\t\tif(numberOfTimes > 0)\r\n\t\t\t\treturn this._preloadImageByIndex(startIndex + 1, numberOfTimes-1);\r\n\t\t}\r\n\r\n\t\t_preloadImage( src, $containerForImage) {\r\n\r\n\t\t\t$containerForImage = $containerForImage || false\r\n\r\n\t\t\tlet img = new Image();\r\n\t\t\tif ($containerForImage) {\r\n\r\n\t\t\t\t// if loading takes > 200ms show a loader\r\n\t\t\t\tlet loadingTimeout = setTimeout(() => {\r\n\t\t\t\t\t$containerForImage.append(this._config.loadingMessage)\r\n\t\t\t\t}, 200)\r\n\r\n\t\t\t\timg.onload = () => {\r\n\t\t\t\t\tif(loadingTimeout)\r\n\t\t\t\t\t\tclearTimeout(loadingTimeout)\r\n\t\t\t\t\tloadingTimeout = null;\r\n\t\t\t\t\tlet image = $('');\r\n\t\t\t\t\timage.attr('src', img.src);\r\n\t\t\t\t\timage.addClass('img-fluid');\r\n\r\n\t\t\t\t\t// backward compatibility for bootstrap v3\r\n\t\t\t\t\timage.css('width', '100%');\r\n\r\n\t\t\t\t\t$containerForImage.html(image);\r\n\t\t\t\t\tif (this._$modalArrows)\r\n\t\t\t\t\t\tthis._$modalArrows.css('display', '') // remove display to default to css property\r\n\r\n\t\t\t\t\tthis._resize(img.width, img.height);\r\n\t\t\t\t\tthis._toggleLoading(false);\r\n\t\t\t\t\treturn this._config.onContentLoaded.call(this);\r\n\t\t\t\t};\r\n\t\t\t\timg.onerror = () => {\r\n\t\t\t\t\tthis._toggleLoading(false);\r\n\t\t\t\t\treturn this._error(this._config.strings.fail+` ${src}`);\r\n\t\t\t\t};\r\n\t\t\t}\r\n\r\n\t\t\timg.src = src;\r\n\t\t\treturn img;\r\n\t\t}\r\n\r\n\t\t_swipeGesure() {\r\n\t\t if (this._touchendX < this._touchstartX) {\r\n\t\t return this.navigateRight();\r\n\t\t }\r\n\t\t if (this._touchendX > this._touchstartX) {\r\n\t\t return this.navigateLeft();\r\n\t\t }\r\n\t\t}\r\n\r\n\t\t_resize( width, height ) {\r\n\r\n\t\t\theight = height || width\r\n\t\t\tthis._wantedWidth = width\r\n\t\t\tthis._wantedHeight = height\r\n\r\n\t\t\tlet imageAspecRatio = width / height;\r\n\r\n\t\t\t// if width > the available space, scale down the expected width and height\r\n\t\t\tlet widthBorderAndPadding = this._padding.left + this._padding.right + this._border.left + this._border.right\r\n\r\n\t\t\t// force 10px margin if window size > 575px\r\n\t\t\tlet addMargin = this._config.doc.body.clientWidth > 575 ? 20 : 0\r\n\t\t\tlet discountMargin = this._config.doc.body.clientWidth > 575 ? 0 : 20\r\n\r\n\t\t\tlet maxWidth = Math.min(width + widthBorderAndPadding, this._config.doc.body.clientWidth - addMargin, this._config.maxWidth)\r\n\r\n\t\t\tif((width + widthBorderAndPadding) > maxWidth) {\r\n\t\t\t\theight = (maxWidth - widthBorderAndPadding - discountMargin) / imageAspecRatio;\r\n\t\t\t\twidth = maxWidth\r\n\t\t\t} else\r\n\t\t\t\twidth = (width + widthBorderAndPadding)\r\n\r\n\t\t\tlet headerHeight = 0,\r\n\t\t\t footerHeight = 0\r\n\r\n\t\t\t// as the resize is performed the modal is show, the calculate might fail\r\n\t\t\t// if so, default to the default sizes\r\n\t\t\tif (this._footerIsShown)\r\n\t\t\t\tfooterHeight = this._$modalFooter.outerHeight(true) || 55\r\n\r\n\t\t\tif (this._titleIsShown)\r\n\t\t\t\theaderHeight = this._$modalHeader.outerHeight(true) || 67\r\n\r\n\t\t\tlet borderPadding = this._padding.top + this._padding.bottom + this._border.bottom + this._border.top\r\n\r\n\t\t\t//calculated each time as resizing the window can cause them to change due to Bootstraps fluid margins\r\n\t\t\tlet margins = parseFloat(this._$modalDialog.css('margin-top')) + parseFloat(this._$modalDialog.css('margin-bottom'));\r\n\r\n\t\t\tlet maxHeight = Math.min(height, $(window).height() - borderPadding - margins - headerHeight - footerHeight, this._config.maxHeight - borderPadding - headerHeight - footerHeight);\r\n\r\n\t\t\tif(height > maxHeight) {\r\n\t\t\t\t// if height > the available height, scale down the width\r\n\t\t\t\twidth = Math.ceil(maxHeight * imageAspecRatio) + widthBorderAndPadding;\r\n\t\t\t}\r\n\r\n\t\t\tthis._$lightboxContainer.css('height', maxHeight)\r\n\t\t\tthis._$modalDialog.css('flex', 1).css('maxWidth', width);\r\n\r\n\t\t\tlet modal = this._$modal.data('bs.modal');\r\n\t\t\tif (modal) {\r\n\t\t\t\t// v4 method is mistakenly protected\r\n\t\t\t\ttry {\r\n\t\t\t\t\tmodal._handleUpdate();\r\n\t\t\t\t} catch(Exception) {\r\n\t\t\t\t\tmodal.handleUpdate();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn this;\r\n\t\t}\r\n\r\n\t\tstatic _jQueryInterface(config) {\r\n\t\t\tconfig = config || {}\r\n\t\t\treturn this.each(() => {\r\n\t\t\t\tlet $this = $(this)\r\n\t\t\t\tlet _config = $.extend(\r\n\t\t\t\t\t{},\r\n\t\t\t\t\tLightbox.Default,\r\n\t\t\t\t\t$this.data(),\r\n\t\t\t\t\ttypeof config === 'object' && config\r\n\t\t\t\t)\r\n\r\n\t\t\t\tnew Lightbox(this, _config)\r\n\t\t\t})\r\n\t\t}\r\n\t}\r\n\r\n\r\n\r\n\t$.fn[NAME] = Lightbox._jQueryInterface\r\n\t$.fn[NAME].Constructor = Lightbox\r\n\t$.fn[NAME].noConflict = () => {\r\n\t\t$.fn[NAME] = JQUERY_NO_CONFLICT\r\n\t\treturn Lightbox._jQueryInterface\r\n\t}\r\n\r\n\treturn Lightbox\r\n\r\n})(jQuery)\r\n\r\nexport default Lightbox\r\n"]}
\ No newline at end of file
diff --git a/dist/ekko-lightbox.min.js b/dist/ekko-lightbox.min.js
index 0289642..8840e20 100644
--- a/dist/ekko-lightbox.min.js
+++ b/dist/ekko-lightbox.min.js
@@ -1,2 +1,2 @@
-+function(a){"use strict";function b(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}var c=function(){function a(a,b){for(var c=0;c
',leftArrow:"❮",rightArrow:"❯",strings:{close:"Close",fail:"Failed to load image:",type:"Could not detect remote target type. Force the type using data-type"},doc:document,onShow:function(){},onShown:function(){},onHide:function(){},onHidden:function(){},onNavigate:function(){},onContentLoaded:function(){}},g=function(){function d(c,e){var g=this;b(this,d),this._config=a.extend({},f,e),this._$modalArrows=null,this._galleryIndex=0,this._galleryName=null,this._padding=null,this._border=null,this._titleIsShown=!1,this._footerIsShown=!1,this._wantedWidth=0,this._wantedHeight=0,this._touchstartX=0,this._touchendX=0,this._modalId="ekkoLightbox-"+Math.floor(1e3*Math.random()+1),this._$element=c instanceof jQuery?c:a(c),this._isBootstrap3=3==a.fn.modal.Constructor.VERSION[0];var h='