lightgallery 2.3.0-beta.4 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lg-settings.d.ts +13 -1
- package/lg-utils.d.ts +15 -3
- package/lib/lg-settings.js +3 -0
- package/lib/lg-settings.js.map +1 -1
- package/lib/lg-utils.js +2 -2
- package/lib/lg-utils.js.map +1 -1
- package/lib/lightgallery.js +16 -4
- package/lib/lightgallery.js.map +1 -1
- package/lightgallery.es5.js +22 -7
- package/lightgallery.es5.js.map +1 -1
- package/lightgallery.min.js +2 -2
- package/lightgallery.umd.js +22 -7
- package/lightgallery.umd.js.map +1 -1
- package/lit/lightgallery.esm.js +7 -7
- package/lit/lightgallery.umd.js +2 -2
- package/package.json +1 -1
- package/plugins/autoplay/lg-autoplay.es5.js +1 -1
- package/plugins/autoplay/lg-autoplay.min.js +1 -1
- package/plugins/autoplay/lg-autoplay.umd.js +1 -1
- package/plugins/comment/lg-comment.es5.js +1 -1
- package/plugins/comment/lg-comment.min.js +1 -1
- package/plugins/comment/lg-comment.umd.js +1 -1
- package/plugins/fullscreen/lg-fullscreen.es5.js +1 -1
- package/plugins/fullscreen/lg-fullscreen.min.js +1 -1
- package/plugins/fullscreen/lg-fullscreen.umd.js +1 -1
- package/plugins/hash/lg-hash.es5.js +1 -1
- package/plugins/hash/lg-hash.min.js +1 -1
- package/plugins/hash/lg-hash.umd.js +1 -1
- package/plugins/mediumZoom/lg-medium-zoom.es5.js +1 -1
- package/plugins/mediumZoom/lg-medium-zoom.min.js +1 -1
- package/plugins/mediumZoom/lg-medium-zoom.umd.js +1 -1
- package/plugins/pager/lg-pager.es5.js +1 -1
- package/plugins/pager/lg-pager.min.js +1 -1
- package/plugins/pager/lg-pager.umd.js +1 -1
- package/plugins/relativeCaption/lg-relative-caption.es5.js +1 -1
- package/plugins/relativeCaption/lg-relative-caption.min.js +1 -1
- package/plugins/relativeCaption/lg-relative-caption.umd.js +1 -1
- package/plugins/rotate/lg-rotate.es5.js +1 -1
- package/plugins/rotate/lg-rotate.min.js +1 -1
- package/plugins/rotate/lg-rotate.umd.js +1 -1
- package/plugins/share/lg-share.es5.js +1 -1
- package/plugins/share/lg-share.min.js +1 -1
- package/plugins/share/lg-share.umd.js +1 -1
- package/plugins/thumbnail/lg-thumbnail.es5.js +1 -1
- package/plugins/thumbnail/lg-thumbnail.min.js +1 -1
- package/plugins/thumbnail/lg-thumbnail.umd.js +1 -1
- package/plugins/video/lg-video.es5.js +1 -1
- package/plugins/video/lg-video.min.js +1 -1
- package/plugins/video/lg-video.umd.js +1 -1
- package/plugins/zoom/lg-zoom.es5.js +1 -1
- package/plugins/zoom/lg-zoom.min.js +1 -1
- package/plugins/zoom/lg-zoom.umd.js +1 -1
- package/react/Lightgallery.es5.js +22 -7
- package/react/Lightgallery.es5.js.map +1 -1
- package/react/Lightgallery.umd.js +22 -7
- package/react/Lightgallery.umd.js.map +1 -1
- package/vue/LightGalleryVue.common.js +154 -139
- package/vue/LightGalleryVue.common.js.map +1 -1
- package/vue/LightGalleryVue.umd.js +154 -139
- package/vue/LightGalleryVue.umd.js.map +1 -1
- package/vue/LightGalleryVue.umd.min.js +2 -2
- package/vue/LightGalleryVue.umd.min.js.map +1 -1
|
@@ -6500,9 +6500,9 @@ var utils = {
|
|
|
6500
6500
|
var transform = 'translate3d(' + (x *= -1) + 'px, ' + (y *= -1) + 'px, 0) scale3d(' + scX + ', ' + scY + ', 1)';
|
|
6501
6501
|
return transform;
|
|
6502
6502
|
},
|
|
6503
|
-
getIframeMarkup: function getIframeMarkup(iframeWidth, iframeHeight, src, iframeTitle) {
|
|
6503
|
+
getIframeMarkup: function getIframeMarkup(iframeWidth, iframeHeight, iframeMaxWidth, iframeMaxHeight, src, iframeTitle) {
|
|
6504
6504
|
var title = iframeTitle ? 'title="' + iframeTitle + '"' : '';
|
|
6505
|
-
return "<div class=\"lg-video-cont lg-has-iframe\" style=\"width:".concat(iframeWidth, "; height: ").concat(iframeHeight, "\">\n <iframe class=\"lg-object\" frameborder=\"0\" ").concat(title, " src=\"").concat(src, "\" allowfullscreen=\"true\"></iframe>\n </div>");
|
|
6505
|
+
return "<div class=\"lg-video-cont lg-has-iframe\" style=\"width:".concat(iframeWidth, "; max-width:").concat(iframeMaxWidth, "; height: ").concat(iframeHeight, "; max-height:").concat(iframeMaxHeight, "\">\n <iframe class=\"lg-object\" frameborder=\"0\" ").concat(title, " src=\"").concat(src, "\" allowfullscreen=\"true\"></iframe>\n </div>");
|
|
6506
6506
|
},
|
|
6507
6507
|
getImgMarkup: function getImgMarkup(index, src, altAttr, srcset, sizes, sources) {
|
|
6508
6508
|
var srcsetAttr = srcset ? "srcset=\"".concat(srcset, "\"") : '';
|
|
@@ -6695,6 +6695,7 @@ var lightGalleryCoreSettings = {
|
|
|
6695
6695
|
supportLegacyBrowser: true,
|
|
6696
6696
|
allowMediaOverlap: false,
|
|
6697
6697
|
videoMaxSize: '1280-720',
|
|
6698
|
+
loadYouTubePoster: true,
|
|
6698
6699
|
defaultCaptionHeight: 0,
|
|
6699
6700
|
ariaLabelledby: '',
|
|
6700
6701
|
ariaDescribedby: '',
|
|
@@ -6722,6 +6723,8 @@ var lightGalleryCoreSettings = {
|
|
|
6722
6723
|
index: 0,
|
|
6723
6724
|
iframeWidth: '100%',
|
|
6724
6725
|
iframeHeight: '100%',
|
|
6726
|
+
iframeMaxWidth: '100%',
|
|
6727
|
+
iframeMaxHeight: '100%',
|
|
6725
6728
|
download: true,
|
|
6726
6729
|
counter: true,
|
|
6727
6730
|
appendCounterTo: '.lg-toolbar',
|
|
@@ -7616,8 +7619,14 @@ var lightgallery_LightGallery = /*#__PURE__*/function () {
|
|
|
7616
7619
|
}, {
|
|
7617
7620
|
key: "addSlideVideoInfo",
|
|
7618
7621
|
value: function addSlideVideoInfo(items) {
|
|
7622
|
+
var _this9 = this;
|
|
7623
|
+
|
|
7619
7624
|
items.forEach(function (element, index) {
|
|
7620
7625
|
element.__slideVideoInfo = lg_utils.isVideo(element.src, !!element.video, index);
|
|
7626
|
+
|
|
7627
|
+
if (element.__slideVideoInfo && _this9.settings.loadYouTubePoster && !element.poster && element.__slideVideoInfo.youtube) {
|
|
7628
|
+
element.poster = "//img.youtube.com/vi/".concat(element.__slideVideoInfo.youtube[1], "/maxresdefault.jpg");
|
|
7629
|
+
}
|
|
7621
7630
|
});
|
|
7622
7631
|
}
|
|
7623
7632
|
/**
|
|
@@ -7630,7 +7639,7 @@ var lightgallery_LightGallery = /*#__PURE__*/function () {
|
|
|
7630
7639
|
}, {
|
|
7631
7640
|
key: "loadContent",
|
|
7632
7641
|
value: function loadContent(index, rec) {
|
|
7633
|
-
var
|
|
7642
|
+
var _this10 = this;
|
|
7634
7643
|
|
|
7635
7644
|
var currentGalleryItem = this.galleryItems[index];
|
|
7636
7645
|
var $currentSlide = $LG(this.getSlideItemId(index));
|
|
@@ -7673,7 +7682,7 @@ var lightgallery_LightGallery = /*#__PURE__*/function () {
|
|
|
7673
7682
|
}
|
|
7674
7683
|
|
|
7675
7684
|
if (iframe) {
|
|
7676
|
-
var markup = lg_utils.getIframeMarkup(this.settings.iframeWidth, this.settings.iframeHeight, src, currentGalleryItem.iframeTitle);
|
|
7685
|
+
var markup = lg_utils.getIframeMarkup(this.settings.iframeWidth, this.settings.iframeHeight, this.settings.iframeMaxWidth, this.settings.iframeMaxHeight, src, currentGalleryItem.iframeTitle);
|
|
7677
7686
|
$currentSlide.prepend(markup);
|
|
7678
7687
|
} else if (poster) {
|
|
7679
7688
|
var dummyImg = '';
|
|
@@ -7733,24 +7742,24 @@ var lightgallery_LightGallery = /*#__PURE__*/function () {
|
|
|
7733
7742
|
|
|
7734
7743
|
if (!$currentSlide.hasClass('lg-loaded')) {
|
|
7735
7744
|
setTimeout(function () {
|
|
7736
|
-
if (
|
|
7745
|
+
if (_this10.getSlideType(currentGalleryItem) === 'image') {
|
|
7737
7746
|
$currentSlide.find('.lg-img-wrap').append(lg_utils.getImgMarkup(index, src, '', srcset, sizes, currentGalleryItem.sources));
|
|
7738
7747
|
|
|
7739
7748
|
if (srcset || sources) {
|
|
7740
7749
|
var _$img = $currentSlide.find('.lg-object');
|
|
7741
7750
|
|
|
7742
|
-
|
|
7751
|
+
_this10.initPictureFill(_$img);
|
|
7743
7752
|
}
|
|
7744
7753
|
}
|
|
7745
7754
|
|
|
7746
|
-
if (
|
|
7747
|
-
|
|
7755
|
+
if (_this10.getSlideType(currentGalleryItem) === 'image' || _this10.getSlideType(currentGalleryItem) === 'video' && poster) {
|
|
7756
|
+
_this10.onLgObjectLoad($currentSlide, index, delay, _speed, true, false); // load remaining slides once the slide is completely loaded
|
|
7748
7757
|
|
|
7749
7758
|
|
|
7750
|
-
|
|
7751
|
-
|
|
7759
|
+
_this10.onSlideObjectLoad($currentSlide, !!(videoInfo && videoInfo.html5 && !poster), function () {
|
|
7760
|
+
_this10.loadContentOnFirstSlideLoad(index, $currentSlide, _speed);
|
|
7752
7761
|
}, function () {
|
|
7753
|
-
|
|
7762
|
+
_this10.loadContentOnFirstSlideLoad(index, $currentSlide, _speed);
|
|
7754
7763
|
});
|
|
7755
7764
|
}
|
|
7756
7765
|
}, this.settings.startAnimationDuration + 100);
|
|
@@ -7778,7 +7787,7 @@ var lightgallery_LightGallery = /*#__PURE__*/function () {
|
|
|
7778
7787
|
if (rec === true) {
|
|
7779
7788
|
if (!$currentSlide.hasClass('lg-complete_')) {
|
|
7780
7789
|
$currentSlide.find('.lg-object').first().on('load.lg error.lg', function () {
|
|
7781
|
-
|
|
7790
|
+
_this10.preload(index);
|
|
7782
7791
|
});
|
|
7783
7792
|
} else {
|
|
7784
7793
|
this.preload(index);
|
|
@@ -7796,23 +7805,23 @@ var lightgallery_LightGallery = /*#__PURE__*/function () {
|
|
|
7796
7805
|
}, {
|
|
7797
7806
|
key: "loadContentOnFirstSlideLoad",
|
|
7798
7807
|
value: function loadContentOnFirstSlideLoad(index, $currentSlide, speed) {
|
|
7799
|
-
var
|
|
7808
|
+
var _this11 = this;
|
|
7800
7809
|
|
|
7801
7810
|
setTimeout(function () {
|
|
7802
7811
|
$currentSlide.find('.lg-dummy-img').remove();
|
|
7803
7812
|
$currentSlide.removeClass('lg-first-slide');
|
|
7804
7813
|
|
|
7805
|
-
|
|
7814
|
+
_this11.outer.removeClass('lg-first-slide-loading');
|
|
7806
7815
|
|
|
7807
|
-
|
|
7816
|
+
_this11.isDummyImageRemoved = true;
|
|
7808
7817
|
|
|
7809
|
-
|
|
7818
|
+
_this11.preload(index);
|
|
7810
7819
|
}, speed + 300);
|
|
7811
7820
|
}
|
|
7812
7821
|
}, {
|
|
7813
7822
|
key: "getItemsToBeInsertedToDom",
|
|
7814
7823
|
value: function getItemsToBeInsertedToDom(index, prevIndex) {
|
|
7815
|
-
var
|
|
7824
|
+
var _this12 = this;
|
|
7816
7825
|
|
|
7817
7826
|
var numberOfItems = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
7818
7827
|
var itemsToBeInsertedToDom = []; // Minimum 2 items should be there
|
|
@@ -7823,7 +7832,7 @@ var lightgallery_LightGallery = /*#__PURE__*/function () {
|
|
|
7823
7832
|
|
|
7824
7833
|
if (this.galleryItems.length <= 3) {
|
|
7825
7834
|
this.galleryItems.forEach(function (_element, index) {
|
|
7826
|
-
itemsToBeInsertedToDom.push("lg-item-".concat(
|
|
7835
|
+
itemsToBeInsertedToDom.push("lg-item-".concat(_this12.lgId, "-").concat(index));
|
|
7827
7836
|
});
|
|
7828
7837
|
return itemsToBeInsertedToDom;
|
|
7829
7838
|
}
|
|
@@ -7867,12 +7876,12 @@ var lightgallery_LightGallery = /*#__PURE__*/function () {
|
|
|
7867
7876
|
}, {
|
|
7868
7877
|
key: "organizeSlideItems",
|
|
7869
7878
|
value: function organizeSlideItems(index, prevIndex) {
|
|
7870
|
-
var
|
|
7879
|
+
var _this13 = this;
|
|
7871
7880
|
|
|
7872
7881
|
var itemsToBeInsertedToDom = this.getItemsToBeInsertedToDom(index, prevIndex, this.settings.numberOfSlideItemsInDom);
|
|
7873
7882
|
itemsToBeInsertedToDom.forEach(function (item) {
|
|
7874
|
-
if (
|
|
7875
|
-
|
|
7883
|
+
if (_this13.currentItemsInDom.indexOf(item) === -1) {
|
|
7884
|
+
_this13.$inner.append("<div id=\"".concat(item, "\" class=\"lg-item\"></div>"));
|
|
7876
7885
|
}
|
|
7877
7886
|
});
|
|
7878
7887
|
this.currentItemsInDom.forEach(function (item) {
|
|
@@ -7923,7 +7932,7 @@ var lightgallery_LightGallery = /*#__PURE__*/function () {
|
|
|
7923
7932
|
}, {
|
|
7924
7933
|
key: "makeSlideAnimation",
|
|
7925
7934
|
value: function makeSlideAnimation(direction, currentSlideItem, previousSlideItem) {
|
|
7926
|
-
var
|
|
7935
|
+
var _this14 = this;
|
|
7927
7936
|
|
|
7928
7937
|
if (this.lGalleryOn) {
|
|
7929
7938
|
previousSlideItem.addClass('lg-slide-progress');
|
|
@@ -7931,9 +7940,9 @@ var lightgallery_LightGallery = /*#__PURE__*/function () {
|
|
|
7931
7940
|
|
|
7932
7941
|
setTimeout(function () {
|
|
7933
7942
|
// remove all transitions
|
|
7934
|
-
|
|
7943
|
+
_this14.outer.addClass('lg-no-trans');
|
|
7935
7944
|
|
|
7936
|
-
|
|
7945
|
+
_this14.outer.find('.lg-item').removeClass('lg-prev-slide lg-next-slide');
|
|
7937
7946
|
|
|
7938
7947
|
if (direction === 'prev') {
|
|
7939
7948
|
//prevslide
|
|
@@ -7947,11 +7956,11 @@ var lightgallery_LightGallery = /*#__PURE__*/function () {
|
|
|
7947
7956
|
|
|
7948
7957
|
|
|
7949
7958
|
setTimeout(function () {
|
|
7950
|
-
|
|
7959
|
+
_this14.outer.find('.lg-item').removeClass('lg-current');
|
|
7951
7960
|
|
|
7952
7961
|
currentSlideItem.addClass('lg-current'); // reset all transitions
|
|
7953
7962
|
|
|
7954
|
-
|
|
7963
|
+
_this14.outer.removeClass('lg-no-trans');
|
|
7955
7964
|
}, 50);
|
|
7956
7965
|
}, this.lGalleryOn ? this.settings.slideDelay : 0);
|
|
7957
7966
|
}
|
|
@@ -7972,7 +7981,7 @@ var lightgallery_LightGallery = /*#__PURE__*/function () {
|
|
|
7972
7981
|
}, {
|
|
7973
7982
|
key: "slide",
|
|
7974
7983
|
value: function slide(index, fromTouch, fromThumb, direction) {
|
|
7975
|
-
var
|
|
7984
|
+
var _this15 = this;
|
|
7976
7985
|
|
|
7977
7986
|
var prevIndex = this.getPreviousSlideIndex();
|
|
7978
7987
|
this.currentItemsInDom = this.organizeSlideItems(index, prevIndex); // Prevent multiple call, Required for hsh plugin
|
|
@@ -8060,20 +8069,20 @@ var lightgallery_LightGallery = /*#__PURE__*/function () {
|
|
|
8060
8069
|
this.loadContent(index, true);
|
|
8061
8070
|
} else {
|
|
8062
8071
|
setTimeout(function () {
|
|
8063
|
-
|
|
8072
|
+
_this15.loadContent(index, true); // Add title if this.settings.appendSubHtmlTo === lg-sub-html
|
|
8064
8073
|
|
|
8065
8074
|
|
|
8066
|
-
if (
|
|
8067
|
-
|
|
8075
|
+
if (_this15.settings.appendSubHtmlTo !== '.lg-item') {
|
|
8076
|
+
_this15.addHtml(index);
|
|
8068
8077
|
}
|
|
8069
8078
|
}, this.settings.speed + 50 + (fromTouch ? 0 : this.settings.slideDelay));
|
|
8070
8079
|
}
|
|
8071
8080
|
|
|
8072
8081
|
setTimeout(function () {
|
|
8073
|
-
|
|
8082
|
+
_this15.lgBusy = false;
|
|
8074
8083
|
previousSlideItem.removeClass('lg-slide-progress');
|
|
8075
8084
|
|
|
8076
|
-
|
|
8085
|
+
_this15.LGel.trigger(lGEvents.afterSlide, {
|
|
8077
8086
|
prevIndex: prevIndex,
|
|
8078
8087
|
index: index,
|
|
8079
8088
|
fromTouch: fromTouch,
|
|
@@ -8160,7 +8169,7 @@ var lightgallery_LightGallery = /*#__PURE__*/function () {
|
|
|
8160
8169
|
}, {
|
|
8161
8170
|
key: "touchEnd",
|
|
8162
8171
|
value: function touchEnd(endCoords, startCoords, event) {
|
|
8163
|
-
var
|
|
8172
|
+
var _this16 = this;
|
|
8164
8173
|
|
|
8165
8174
|
var distance; // keep slide animation for any mode while dragg/swipe
|
|
8166
8175
|
|
|
@@ -8170,61 +8179,61 @@ var lightgallery_LightGallery = /*#__PURE__*/function () {
|
|
|
8170
8179
|
|
|
8171
8180
|
|
|
8172
8181
|
setTimeout(function () {
|
|
8173
|
-
|
|
8182
|
+
_this16.$container.removeClass('lg-dragging-vertical');
|
|
8174
8183
|
|
|
8175
|
-
|
|
8184
|
+
_this16.outer.removeClass('lg-dragging lg-hide-items').addClass('lg-components-open');
|
|
8176
8185
|
|
|
8177
8186
|
var triggerClick = true;
|
|
8178
8187
|
|
|
8179
|
-
if (
|
|
8188
|
+
if (_this16.swipeDirection === 'horizontal') {
|
|
8180
8189
|
distance = endCoords.pageX - startCoords.pageX;
|
|
8181
8190
|
var distanceAbs = Math.abs(endCoords.pageX - startCoords.pageX);
|
|
8182
8191
|
|
|
8183
|
-
if (distance < 0 && distanceAbs >
|
|
8184
|
-
|
|
8192
|
+
if (distance < 0 && distanceAbs > _this16.settings.swipeThreshold) {
|
|
8193
|
+
_this16.goToNextSlide(true);
|
|
8185
8194
|
|
|
8186
8195
|
triggerClick = false;
|
|
8187
|
-
} else if (distance > 0 && distanceAbs >
|
|
8188
|
-
|
|
8196
|
+
} else if (distance > 0 && distanceAbs > _this16.settings.swipeThreshold) {
|
|
8197
|
+
_this16.goToPrevSlide(true);
|
|
8189
8198
|
|
|
8190
8199
|
triggerClick = false;
|
|
8191
8200
|
}
|
|
8192
|
-
} else if (
|
|
8201
|
+
} else if (_this16.swipeDirection === 'vertical') {
|
|
8193
8202
|
distance = Math.abs(endCoords.pageY - startCoords.pageY);
|
|
8194
8203
|
|
|
8195
|
-
if (
|
|
8196
|
-
|
|
8204
|
+
if (_this16.settings.closable && _this16.settings.swipeToClose && distance > 100) {
|
|
8205
|
+
_this16.closeGallery();
|
|
8197
8206
|
|
|
8198
8207
|
return;
|
|
8199
8208
|
} else {
|
|
8200
|
-
|
|
8209
|
+
_this16.$backdrop.css('opacity', 1);
|
|
8201
8210
|
}
|
|
8202
8211
|
}
|
|
8203
8212
|
|
|
8204
|
-
|
|
8213
|
+
_this16.outer.find('.lg-item').removeAttr('style');
|
|
8205
8214
|
|
|
8206
8215
|
if (triggerClick && Math.abs(endCoords.pageX - startCoords.pageX) < 5) {
|
|
8207
8216
|
// Trigger click if distance is less than 5 pix
|
|
8208
8217
|
var target = $LG(event.target);
|
|
8209
8218
|
|
|
8210
|
-
if (
|
|
8211
|
-
|
|
8219
|
+
if (_this16.isPosterElement(target)) {
|
|
8220
|
+
_this16.LGel.trigger(lGEvents.posterClick);
|
|
8212
8221
|
}
|
|
8213
8222
|
}
|
|
8214
8223
|
|
|
8215
|
-
|
|
8224
|
+
_this16.swipeDirection = undefined;
|
|
8216
8225
|
}); // remove slide class once drag/swipe is completed if mode is not slide
|
|
8217
8226
|
|
|
8218
8227
|
setTimeout(function () {
|
|
8219
|
-
if (!
|
|
8220
|
-
|
|
8228
|
+
if (!_this16.outer.hasClass('lg-dragging') && _this16.settings.mode !== 'lg-slide') {
|
|
8229
|
+
_this16.outer.removeClass('lg-slide');
|
|
8221
8230
|
}
|
|
8222
8231
|
}, this.settings.speed + 100);
|
|
8223
8232
|
}
|
|
8224
8233
|
}, {
|
|
8225
8234
|
key: "enableSwipe",
|
|
8226
8235
|
value: function enableSwipe() {
|
|
8227
|
-
var
|
|
8236
|
+
var _this17 = this;
|
|
8228
8237
|
|
|
8229
8238
|
var startCoords = {};
|
|
8230
8239
|
var endCoords = {};
|
|
@@ -8233,15 +8242,15 @@ var lightgallery_LightGallery = /*#__PURE__*/function () {
|
|
|
8233
8242
|
|
|
8234
8243
|
if (this.settings.enableSwipe) {
|
|
8235
8244
|
this.$inner.on('touchstart.lg', function (e) {
|
|
8236
|
-
|
|
8245
|
+
_this17.dragOrSwipeEnabled = true;
|
|
8237
8246
|
|
|
8238
|
-
var $item =
|
|
8247
|
+
var $item = _this17.getSlideItem(_this17.index);
|
|
8239
8248
|
|
|
8240
|
-
if (($LG(e.target).hasClass('lg-item') || $item.get().contains(e.target)) && !
|
|
8249
|
+
if (($LG(e.target).hasClass('lg-item') || $item.get().contains(e.target)) && !_this17.outer.hasClass('lg-zoomed') && !_this17.lgBusy && e.targetTouches.length === 1) {
|
|
8241
8250
|
isSwiping = true;
|
|
8242
|
-
|
|
8251
|
+
_this17.touchAction = 'swipe';
|
|
8243
8252
|
|
|
8244
|
-
|
|
8253
|
+
_this17.manageSwipeClass();
|
|
8245
8254
|
|
|
8246
8255
|
startCoords = {
|
|
8247
8256
|
pageX: e.targetTouches[0].pageX,
|
|
@@ -8250,32 +8259,32 @@ var lightgallery_LightGallery = /*#__PURE__*/function () {
|
|
|
8250
8259
|
}
|
|
8251
8260
|
});
|
|
8252
8261
|
this.$inner.on('touchmove.lg', function (e) {
|
|
8253
|
-
if (isSwiping &&
|
|
8262
|
+
if (isSwiping && _this17.touchAction === 'swipe' && e.targetTouches.length === 1) {
|
|
8254
8263
|
endCoords = {
|
|
8255
8264
|
pageX: e.targetTouches[0].pageX,
|
|
8256
8265
|
pageY: e.targetTouches[0].pageY
|
|
8257
8266
|
};
|
|
8258
8267
|
|
|
8259
|
-
|
|
8268
|
+
_this17.touchMove(startCoords, endCoords, e);
|
|
8260
8269
|
|
|
8261
8270
|
isMoved = true;
|
|
8262
8271
|
}
|
|
8263
8272
|
});
|
|
8264
8273
|
this.$inner.on('touchend.lg', function (event) {
|
|
8265
|
-
if (
|
|
8274
|
+
if (_this17.touchAction === 'swipe') {
|
|
8266
8275
|
if (isMoved) {
|
|
8267
8276
|
isMoved = false;
|
|
8268
8277
|
|
|
8269
|
-
|
|
8278
|
+
_this17.touchEnd(endCoords, startCoords, event);
|
|
8270
8279
|
} else if (isSwiping) {
|
|
8271
8280
|
var target = $LG(event.target);
|
|
8272
8281
|
|
|
8273
|
-
if (
|
|
8274
|
-
|
|
8282
|
+
if (_this17.isPosterElement(target)) {
|
|
8283
|
+
_this17.LGel.trigger(lGEvents.posterClick);
|
|
8275
8284
|
}
|
|
8276
8285
|
}
|
|
8277
8286
|
|
|
8278
|
-
|
|
8287
|
+
_this17.touchAction = undefined;
|
|
8279
8288
|
isSwiping = false;
|
|
8280
8289
|
}
|
|
8281
8290
|
});
|
|
@@ -8284,7 +8293,7 @@ var lightgallery_LightGallery = /*#__PURE__*/function () {
|
|
|
8284
8293
|
}, {
|
|
8285
8294
|
key: "enableDrag",
|
|
8286
8295
|
value: function enableDrag() {
|
|
8287
|
-
var
|
|
8296
|
+
var _this18 = this;
|
|
8288
8297
|
|
|
8289
8298
|
var startCoords = {};
|
|
8290
8299
|
var endCoords = {};
|
|
@@ -8293,16 +8302,16 @@ var lightgallery_LightGallery = /*#__PURE__*/function () {
|
|
|
8293
8302
|
|
|
8294
8303
|
if (this.settings.enableDrag) {
|
|
8295
8304
|
this.outer.on('mousedown.lg', function (e) {
|
|
8296
|
-
|
|
8305
|
+
_this18.dragOrSwipeEnabled = true;
|
|
8297
8306
|
|
|
8298
|
-
var $item =
|
|
8307
|
+
var $item = _this18.getSlideItem(_this18.index);
|
|
8299
8308
|
|
|
8300
8309
|
if ($LG(e.target).hasClass('lg-item') || $item.get().contains(e.target)) {
|
|
8301
|
-
if (!
|
|
8310
|
+
if (!_this18.outer.hasClass('lg-zoomed') && !_this18.lgBusy) {
|
|
8302
8311
|
e.preventDefault();
|
|
8303
8312
|
|
|
8304
|
-
if (!
|
|
8305
|
-
|
|
8313
|
+
if (!_this18.lgBusy) {
|
|
8314
|
+
_this18.manageSwipeClass();
|
|
8306
8315
|
|
|
8307
8316
|
startCoords = {
|
|
8308
8317
|
pageX: e.pageX,
|
|
@@ -8310,31 +8319,31 @@ var lightgallery_LightGallery = /*#__PURE__*/function () {
|
|
|
8310
8319
|
};
|
|
8311
8320
|
isDraging = true; // ** Fix for webkit cursor issue https://code.google.com/p/chromium/issues/detail?id=26723
|
|
8312
8321
|
|
|
8313
|
-
|
|
8314
|
-
|
|
8322
|
+
_this18.outer.get().scrollLeft += 1;
|
|
8323
|
+
_this18.outer.get().scrollLeft -= 1; // *
|
|
8315
8324
|
|
|
8316
|
-
|
|
8325
|
+
_this18.outer.removeClass('lg-grab').addClass('lg-grabbing');
|
|
8317
8326
|
|
|
8318
|
-
|
|
8327
|
+
_this18.LGel.trigger(lGEvents.dragStart);
|
|
8319
8328
|
}
|
|
8320
8329
|
}
|
|
8321
8330
|
}
|
|
8322
8331
|
});
|
|
8323
8332
|
$LG(window).on("mousemove.lg.global".concat(this.lgId), function (e) {
|
|
8324
|
-
if (isDraging &&
|
|
8333
|
+
if (isDraging && _this18.lgOpened) {
|
|
8325
8334
|
isMoved = true;
|
|
8326
8335
|
endCoords = {
|
|
8327
8336
|
pageX: e.pageX,
|
|
8328
8337
|
pageY: e.pageY
|
|
8329
8338
|
};
|
|
8330
8339
|
|
|
8331
|
-
|
|
8340
|
+
_this18.touchMove(startCoords, endCoords);
|
|
8332
8341
|
|
|
8333
|
-
|
|
8342
|
+
_this18.LGel.trigger(lGEvents.dragMove);
|
|
8334
8343
|
}
|
|
8335
8344
|
});
|
|
8336
8345
|
$LG(window).on("mouseup.lg.global".concat(this.lgId), function (event) {
|
|
8337
|
-
if (!
|
|
8346
|
+
if (!_this18.lgOpened) {
|
|
8338
8347
|
return;
|
|
8339
8348
|
}
|
|
8340
8349
|
|
|
@@ -8343,18 +8352,18 @@ var lightgallery_LightGallery = /*#__PURE__*/function () {
|
|
|
8343
8352
|
if (isMoved) {
|
|
8344
8353
|
isMoved = false;
|
|
8345
8354
|
|
|
8346
|
-
|
|
8355
|
+
_this18.touchEnd(endCoords, startCoords, event);
|
|
8347
8356
|
|
|
8348
|
-
|
|
8349
|
-
} else if (
|
|
8350
|
-
|
|
8357
|
+
_this18.LGel.trigger(lGEvents.dragEnd);
|
|
8358
|
+
} else if (_this18.isPosterElement(target)) {
|
|
8359
|
+
_this18.LGel.trigger(lGEvents.posterClick);
|
|
8351
8360
|
} // Prevent execution on click
|
|
8352
8361
|
|
|
8353
8362
|
|
|
8354
8363
|
if (isDraging) {
|
|
8355
8364
|
isDraging = false;
|
|
8356
8365
|
|
|
8357
|
-
|
|
8366
|
+
_this18.outer.removeClass('lg-grabbing').addClass('lg-grab');
|
|
8358
8367
|
}
|
|
8359
8368
|
});
|
|
8360
8369
|
}
|
|
@@ -8362,11 +8371,11 @@ var lightgallery_LightGallery = /*#__PURE__*/function () {
|
|
|
8362
8371
|
}, {
|
|
8363
8372
|
key: "triggerPosterClick",
|
|
8364
8373
|
value: function triggerPosterClick() {
|
|
8365
|
-
var
|
|
8374
|
+
var _this19 = this;
|
|
8366
8375
|
|
|
8367
8376
|
this.$inner.on('click.lg', function (event) {
|
|
8368
|
-
if (!
|
|
8369
|
-
|
|
8377
|
+
if (!_this19.dragOrSwipeEnabled && _this19.isPosterElement($LG(event.target))) {
|
|
8378
|
+
_this19.LGel.trigger(lGEvents.posterClick);
|
|
8370
8379
|
}
|
|
8371
8380
|
});
|
|
8372
8381
|
}
|
|
@@ -8406,7 +8415,7 @@ var lightgallery_LightGallery = /*#__PURE__*/function () {
|
|
|
8406
8415
|
}, {
|
|
8407
8416
|
key: "goToNextSlide",
|
|
8408
8417
|
value: function goToNextSlide(fromTouch) {
|
|
8409
|
-
var
|
|
8418
|
+
var _this20 = this;
|
|
8410
8419
|
|
|
8411
8420
|
var _loop = this.settings.loop;
|
|
8412
8421
|
|
|
@@ -8431,7 +8440,7 @@ var lightgallery_LightGallery = /*#__PURE__*/function () {
|
|
|
8431
8440
|
} else if (this.settings.slideEndAnimation && !fromTouch) {
|
|
8432
8441
|
this.outer.addClass('lg-right-end');
|
|
8433
8442
|
setTimeout(function () {
|
|
8434
|
-
|
|
8443
|
+
_this20.outer.removeClass('lg-right-end');
|
|
8435
8444
|
}, 400);
|
|
8436
8445
|
}
|
|
8437
8446
|
}
|
|
@@ -8451,7 +8460,7 @@ var lightgallery_LightGallery = /*#__PURE__*/function () {
|
|
|
8451
8460
|
}, {
|
|
8452
8461
|
key: "goToPrevSlide",
|
|
8453
8462
|
value: function goToPrevSlide(fromTouch) {
|
|
8454
|
-
var
|
|
8463
|
+
var _this21 = this;
|
|
8455
8464
|
|
|
8456
8465
|
var _loop = this.settings.loop;
|
|
8457
8466
|
|
|
@@ -8478,7 +8487,7 @@ var lightgallery_LightGallery = /*#__PURE__*/function () {
|
|
|
8478
8487
|
} else if (this.settings.slideEndAnimation && !fromTouch) {
|
|
8479
8488
|
this.outer.addClass('lg-left-end');
|
|
8480
8489
|
setTimeout(function () {
|
|
8481
|
-
|
|
8490
|
+
_this21.outer.removeClass('lg-left-end');
|
|
8482
8491
|
}, 400);
|
|
8483
8492
|
}
|
|
8484
8493
|
}
|
|
@@ -8487,30 +8496,30 @@ var lightgallery_LightGallery = /*#__PURE__*/function () {
|
|
|
8487
8496
|
}, {
|
|
8488
8497
|
key: "keyPress",
|
|
8489
8498
|
value: function keyPress() {
|
|
8490
|
-
var
|
|
8499
|
+
var _this22 = this;
|
|
8491
8500
|
|
|
8492
8501
|
$LG(window).on("keydown.lg.global".concat(this.lgId), function (e) {
|
|
8493
|
-
if (
|
|
8502
|
+
if (_this22.lgOpened && _this22.settings.escKey === true && e.keyCode === 27) {
|
|
8494
8503
|
e.preventDefault();
|
|
8495
8504
|
|
|
8496
|
-
if (
|
|
8497
|
-
|
|
8505
|
+
if (_this22.settings.allowMediaOverlap && _this22.outer.hasClass('lg-can-toggle') && _this22.outer.hasClass('lg-components-open')) {
|
|
8506
|
+
_this22.outer.removeClass('lg-components-open');
|
|
8498
8507
|
} else {
|
|
8499
|
-
|
|
8508
|
+
_this22.closeGallery();
|
|
8500
8509
|
}
|
|
8501
8510
|
}
|
|
8502
8511
|
|
|
8503
|
-
if (
|
|
8512
|
+
if (_this22.lgOpened && _this22.galleryItems.length > 1) {
|
|
8504
8513
|
if (e.keyCode === 37) {
|
|
8505
8514
|
e.preventDefault();
|
|
8506
8515
|
|
|
8507
|
-
|
|
8516
|
+
_this22.goToPrevSlide();
|
|
8508
8517
|
}
|
|
8509
8518
|
|
|
8510
8519
|
if (e.keyCode === 39) {
|
|
8511
8520
|
e.preventDefault();
|
|
8512
8521
|
|
|
8513
|
-
|
|
8522
|
+
_this22.goToNextSlide();
|
|
8514
8523
|
}
|
|
8515
8524
|
}
|
|
8516
8525
|
});
|
|
@@ -8518,13 +8527,13 @@ var lightgallery_LightGallery = /*#__PURE__*/function () {
|
|
|
8518
8527
|
}, {
|
|
8519
8528
|
key: "arrow",
|
|
8520
8529
|
value: function arrow() {
|
|
8521
|
-
var
|
|
8530
|
+
var _this23 = this;
|
|
8522
8531
|
|
|
8523
8532
|
this.getElementById('lg-prev').on('click.lg', function () {
|
|
8524
|
-
|
|
8533
|
+
_this23.goToPrevSlide();
|
|
8525
8534
|
});
|
|
8526
8535
|
this.getElementById('lg-next').on('click.lg', function () {
|
|
8527
|
-
|
|
8536
|
+
_this23.goToNextSlide();
|
|
8528
8537
|
});
|
|
8529
8538
|
}
|
|
8530
8539
|
}, {
|
|
@@ -8558,21 +8567,27 @@ var lightgallery_LightGallery = /*#__PURE__*/function () {
|
|
|
8558
8567
|
}, {
|
|
8559
8568
|
key: "mousewheel",
|
|
8560
8569
|
value: function mousewheel() {
|
|
8561
|
-
var
|
|
8570
|
+
var _this24 = this;
|
|
8562
8571
|
|
|
8563
|
-
|
|
8564
|
-
|
|
8572
|
+
var lastCall = 0;
|
|
8573
|
+
this.outer.on('wheel.lg', function (e) {
|
|
8574
|
+
if (!e.deltaY || _this24.galleryItems.length < 2) {
|
|
8565
8575
|
return;
|
|
8566
8576
|
}
|
|
8567
8577
|
|
|
8568
|
-
|
|
8569
|
-
|
|
8578
|
+
e.preventDefault();
|
|
8579
|
+
var now = new Date().getTime();
|
|
8570
8580
|
|
|
8571
|
-
|
|
8572
|
-
|
|
8573
|
-
|
|
8581
|
+
if (now - lastCall < 1000) {
|
|
8582
|
+
return;
|
|
8583
|
+
}
|
|
8574
8584
|
|
|
8575
|
-
|
|
8585
|
+
lastCall = now;
|
|
8586
|
+
|
|
8587
|
+
if (e.deltaY > 0) {
|
|
8588
|
+
_this24.goToNextSlide();
|
|
8589
|
+
} else if (e.deltaY < 0) {
|
|
8590
|
+
_this24.goToPrevSlide();
|
|
8576
8591
|
}
|
|
8577
8592
|
});
|
|
8578
8593
|
}
|
|
@@ -8595,12 +8610,12 @@ var lightgallery_LightGallery = /*#__PURE__*/function () {
|
|
|
8595
8610
|
}, {
|
|
8596
8611
|
key: "toggleMaximize",
|
|
8597
8612
|
value: function toggleMaximize() {
|
|
8598
|
-
var
|
|
8613
|
+
var _this25 = this;
|
|
8599
8614
|
|
|
8600
8615
|
this.getElementById('lg-maximize').on('click.lg', function () {
|
|
8601
|
-
|
|
8616
|
+
_this25.$container.toggleClass('lg-inline');
|
|
8602
8617
|
|
|
8603
|
-
|
|
8618
|
+
_this25.refreshOnResize();
|
|
8604
8619
|
});
|
|
8605
8620
|
}
|
|
8606
8621
|
}, {
|
|
@@ -8615,12 +8630,12 @@ var lightgallery_LightGallery = /*#__PURE__*/function () {
|
|
|
8615
8630
|
}, {
|
|
8616
8631
|
key: "manageCloseGallery",
|
|
8617
8632
|
value: function manageCloseGallery() {
|
|
8618
|
-
var
|
|
8633
|
+
var _this26 = this;
|
|
8619
8634
|
|
|
8620
8635
|
if (!this.settings.closable) return;
|
|
8621
8636
|
var mousedown = false;
|
|
8622
8637
|
this.getElementById('lg-close').on('click.lg', function () {
|
|
8623
|
-
|
|
8638
|
+
_this26.closeGallery();
|
|
8624
8639
|
});
|
|
8625
8640
|
|
|
8626
8641
|
if (this.settings.closeOnTap) {
|
|
@@ -8629,7 +8644,7 @@ var lightgallery_LightGallery = /*#__PURE__*/function () {
|
|
|
8629
8644
|
this.outer.on('mousedown.lg', function (e) {
|
|
8630
8645
|
var target = $LG(e.target);
|
|
8631
8646
|
|
|
8632
|
-
if (
|
|
8647
|
+
if (_this26.isSlideElement(target)) {
|
|
8633
8648
|
mousedown = true;
|
|
8634
8649
|
} else {
|
|
8635
8650
|
mousedown = false;
|
|
@@ -8641,9 +8656,9 @@ var lightgallery_LightGallery = /*#__PURE__*/function () {
|
|
|
8641
8656
|
this.outer.on('mouseup.lg', function (e) {
|
|
8642
8657
|
var target = $LG(e.target);
|
|
8643
8658
|
|
|
8644
|
-
if (
|
|
8645
|
-
if (!
|
|
8646
|
-
|
|
8659
|
+
if (_this26.isSlideElement(target) && mousedown) {
|
|
8660
|
+
if (!_this26.outer.hasClass('lg-dragging')) {
|
|
8661
|
+
_this26.closeGallery();
|
|
8647
8662
|
}
|
|
8648
8663
|
}
|
|
8649
8664
|
});
|
|
@@ -8664,7 +8679,7 @@ var lightgallery_LightGallery = /*#__PURE__*/function () {
|
|
|
8664
8679
|
}, {
|
|
8665
8680
|
key: "closeGallery",
|
|
8666
8681
|
value: function closeGallery(force) {
|
|
8667
|
-
var
|
|
8682
|
+
var _this27 = this;
|
|
8668
8683
|
|
|
8669
8684
|
if (!this.lgOpened || !this.settings.closable && !force) {
|
|
8670
8685
|
return 0;
|
|
@@ -8713,32 +8728,32 @@ var lightgallery_LightGallery = /*#__PURE__*/function () {
|
|
|
8713
8728
|
this.$container.removeClass('lg-show-in'); // Once the closign animation is completed and gallery is invisible
|
|
8714
8729
|
|
|
8715
8730
|
setTimeout(function () {
|
|
8716
|
-
if (
|
|
8717
|
-
|
|
8731
|
+
if (_this27.zoomFromOrigin && transform) {
|
|
8732
|
+
_this27.outer.removeClass('lg-zoom-from-image');
|
|
8718
8733
|
}
|
|
8719
8734
|
|
|
8720
|
-
|
|
8735
|
+
_this27.$container.removeClass('lg-show'); // Need to remove inline opacity as it is used in the stylesheet as well
|
|
8721
8736
|
|
|
8722
8737
|
|
|
8723
|
-
|
|
8738
|
+
_this27.$backdrop.removeAttr('style').css('transition-duration', _this27.settings.backdropDuration + 'ms');
|
|
8724
8739
|
|
|
8725
|
-
|
|
8740
|
+
_this27.outer.removeClass("lg-closing ".concat(_this27.settings.startClass));
|
|
8726
8741
|
|
|
8727
|
-
|
|
8742
|
+
_this27.getSlideItem(_this27.index).removeClass('lg-start-end-progress');
|
|
8728
8743
|
|
|
8729
|
-
|
|
8744
|
+
_this27.$inner.empty();
|
|
8730
8745
|
|
|
8731
|
-
if (
|
|
8732
|
-
|
|
8733
|
-
instance:
|
|
8746
|
+
if (_this27.lgOpened) {
|
|
8747
|
+
_this27.LGel.trigger(lGEvents.afterClose, {
|
|
8748
|
+
instance: _this27
|
|
8734
8749
|
});
|
|
8735
8750
|
}
|
|
8736
8751
|
|
|
8737
|
-
if (
|
|
8738
|
-
|
|
8752
|
+
if (_this27.outer.get()) {
|
|
8753
|
+
_this27.outer.get().blur();
|
|
8739
8754
|
}
|
|
8740
8755
|
|
|
8741
|
-
|
|
8756
|
+
_this27.lgOpened = false;
|
|
8742
8757
|
}, removeTimeout + 100);
|
|
8743
8758
|
return removeTimeout + 100;
|
|
8744
8759
|
}
|
|
@@ -8824,21 +8839,21 @@ var lightgallery_LightGallery = /*#__PURE__*/function () {
|
|
|
8824
8839
|
}, {
|
|
8825
8840
|
key: "destroy",
|
|
8826
8841
|
value: function destroy() {
|
|
8827
|
-
var
|
|
8842
|
+
var _this28 = this;
|
|
8828
8843
|
|
|
8829
8844
|
var closeTimeout = this.closeGallery(true);
|
|
8830
8845
|
setTimeout(function () {
|
|
8831
|
-
|
|
8846
|
+
_this28.destroyModules(true);
|
|
8832
8847
|
|
|
8833
|
-
if (!
|
|
8834
|
-
|
|
8848
|
+
if (!_this28.settings.dynamic) {
|
|
8849
|
+
_this28.invalidateItems();
|
|
8835
8850
|
}
|
|
8836
8851
|
|
|
8837
|
-
$LG(window).off(".lg.global".concat(
|
|
8852
|
+
$LG(window).off(".lg.global".concat(_this28.lgId));
|
|
8838
8853
|
|
|
8839
|
-
|
|
8854
|
+
_this28.LGel.off('.lg');
|
|
8840
8855
|
|
|
8841
|
-
|
|
8856
|
+
_this28.$container.remove();
|
|
8842
8857
|
}, closeTimeout);
|
|
8843
8858
|
return closeTimeout;
|
|
8844
8859
|
}
|