lightgallery 2.5.0-beta.3 → 2.5.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/css/lightgallery-bundle.css +4 -0
- package/css/lightgallery-bundle.min.css +1 -1
- package/css/lightgallery-core.css +4 -0
- package/css/lightgallery.css +4 -0
- package/lg-settings.d.ts +14 -1
- package/lib/lg-settings.js +2 -0
- package/lib/lg-settings.js.map +1 -1
- package/lib/lightgallery.js +34 -3
- package/lib/lightgallery.js.map +1 -1
- package/lib/plugins/video/lg-video-settings.js.map +1 -1
- package/lightgallery.d.ts +4 -0
- package/lightgallery.es5.js +37 -4
- package/lightgallery.es5.js.map +1 -1
- package/lightgallery.min.js +2 -2
- package/lightgallery.umd.js +37 -4
- package/lightgallery.umd.js.map +1 -1
- package/lit/lightgallery.esm.js +4 -4
- 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-settings.d.ts +1 -0
- package/plugins/video/lg-video.es5.js +1 -1
- package/plugins/video/lg-video.es5.js.map +1 -1
- package/plugins/video/lg-video.min.js +1 -1
- package/plugins/video/lg-video.umd.js +1 -1
- package/plugins/video/lg-video.umd.js.map +1 -1
- package/plugins/vimeoThumbnail/lg-vimeo-thumbnail.es5.js +1 -1
- package/plugins/vimeoThumbnail/lg-vimeo-thumbnail.min.js +1 -1
- package/plugins/vimeoThumbnail/lg-vimeo-thumbnail.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 +37 -4
- package/react/Lightgallery.es5.js.map +1 -1
- package/react/Lightgallery.umd.js +37 -4
- package/react/Lightgallery.umd.js.map +1 -1
- package/scss/lightgallery-core.scss +3 -0
- package/vue/LightGalleryVue.common.js +48 -5
- package/vue/LightGalleryVue.common.js.map +1 -1
- package/vue/LightGalleryVue.umd.js +48 -5
- 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
|
@@ -5863,6 +5863,8 @@ var lightGalleryCoreSettings = {
|
|
|
5863
5863
|
defaultCaptionHeight: 0,
|
|
5864
5864
|
ariaLabelledby: '',
|
|
5865
5865
|
ariaDescribedby: '',
|
|
5866
|
+
resetScrollPosition: true,
|
|
5867
|
+
hideScrollbar: false,
|
|
5866
5868
|
closable: true,
|
|
5867
5869
|
swipeToClose: true,
|
|
5868
5870
|
closeOnTap: true,
|
|
@@ -6820,6 +6822,7 @@ var lightgallery_LightGallery = /*#__PURE__*/function () {
|
|
|
6820
6822
|
this.currentItemsInDom = []; // Scroll top value before lightGallery is opened
|
|
6821
6823
|
|
|
6822
6824
|
this.prevScrollTop = 0;
|
|
6825
|
+
this.bodyPaddingRight = 0;
|
|
6823
6826
|
this.isDummyImageRemoved = false;
|
|
6824
6827
|
this.dragOrSwipeEnabled = false;
|
|
6825
6828
|
this.mediaContainerPosition = {
|
|
@@ -7213,6 +7216,34 @@ var lightgallery_LightGallery = /*#__PURE__*/function () {
|
|
|
7213
7216
|
return this.settings.dynamicEl || [];
|
|
7214
7217
|
}
|
|
7215
7218
|
}
|
|
7219
|
+
}, {
|
|
7220
|
+
key: "shouldHideScrollbar",
|
|
7221
|
+
value: function shouldHideScrollbar() {
|
|
7222
|
+
return this.settings.hideScrollbar && document.body === this.settings.container;
|
|
7223
|
+
}
|
|
7224
|
+
}, {
|
|
7225
|
+
key: "hideScrollbar",
|
|
7226
|
+
value: function hideScrollbar() {
|
|
7227
|
+
if (!this.shouldHideScrollbar()) {
|
|
7228
|
+
return;
|
|
7229
|
+
}
|
|
7230
|
+
|
|
7231
|
+
this.bodyPaddingRight = parseFloat($LG('body').style().paddingRight);
|
|
7232
|
+
var bodyRect = document.documentElement.getBoundingClientRect();
|
|
7233
|
+
var scrollbarWidth = window.innerWidth - bodyRect.width;
|
|
7234
|
+
$LG(document.body).css('padding-right', scrollbarWidth + this.bodyPaddingRight + 'px');
|
|
7235
|
+
$LG(document.body).addClass('lg-overlay-open');
|
|
7236
|
+
}
|
|
7237
|
+
}, {
|
|
7238
|
+
key: "resetScrollBar",
|
|
7239
|
+
value: function resetScrollBar() {
|
|
7240
|
+
if (!this.shouldHideScrollbar()) {
|
|
7241
|
+
return;
|
|
7242
|
+
}
|
|
7243
|
+
|
|
7244
|
+
$LG(document.body).css('padding-right', this.bodyPaddingRight + 'px');
|
|
7245
|
+
$LG(document.body).removeClass('lg-overlay-open');
|
|
7246
|
+
}
|
|
7216
7247
|
/**
|
|
7217
7248
|
* Open lightGallery.
|
|
7218
7249
|
* Open gallery with specific slide by passing index of the slide as parameter.
|
|
@@ -7252,7 +7283,8 @@ var lightgallery_LightGallery = /*#__PURE__*/function () {
|
|
|
7252
7283
|
// prevent accidental double execution
|
|
7253
7284
|
if (this.lgOpened) return;
|
|
7254
7285
|
this.lgOpened = true;
|
|
7255
|
-
this.outer.removeClass('lg-hide-items');
|
|
7286
|
+
this.outer.removeClass('lg-hide-items');
|
|
7287
|
+
this.hideScrollbar(); // Add display block, but still has opacity 0
|
|
7256
7288
|
|
|
7257
7289
|
this.$container.addClass('lg-show');
|
|
7258
7290
|
var itemsToBeInsertedToDom = this.getItemsToBeInsertedToDom(index, index);
|
|
@@ -7766,7 +7798,9 @@ var lightgallery_LightGallery = /*#__PURE__*/function () {
|
|
|
7766
7798
|
if (!$currentSlide.hasClass('lg-loaded')) {
|
|
7767
7799
|
setTimeout(function () {
|
|
7768
7800
|
if (_this10.getSlideType(currentGalleryItem) === 'image') {
|
|
7769
|
-
|
|
7801
|
+
var alt = currentGalleryItem.alt;
|
|
7802
|
+
var altAttr = alt ? 'alt="' + alt + '"' : '';
|
|
7803
|
+
$currentSlide.find('.lg-img-wrap').append(lg_utils.getImgMarkup(index, src, altAttr, srcset, sizes, currentGalleryItem.sources));
|
|
7770
7804
|
|
|
7771
7805
|
if (srcset || sources) {
|
|
7772
7806
|
var _$img = $currentSlide.find('.lg-object');
|
|
@@ -8655,7 +8689,9 @@ var lightgallery_LightGallery = /*#__PURE__*/function () {
|
|
|
8655
8689
|
value: function trapFocus() {
|
|
8656
8690
|
var _this26 = this;
|
|
8657
8691
|
|
|
8658
|
-
this.$container.get().focus(
|
|
8692
|
+
this.$container.get().focus({
|
|
8693
|
+
preventScroll: true
|
|
8694
|
+
});
|
|
8659
8695
|
$LG(window).on("keydown.lg.global".concat(this.lgId), function (e) {
|
|
8660
8696
|
if (!_this26.lgOpened) {
|
|
8661
8697
|
return;
|
|
@@ -8743,7 +8779,11 @@ var lightgallery_LightGallery = /*#__PURE__*/function () {
|
|
|
8743
8779
|
}
|
|
8744
8780
|
|
|
8745
8781
|
this.LGel.trigger(lGEvents.beforeClose);
|
|
8746
|
-
|
|
8782
|
+
|
|
8783
|
+
if (this.settings.resetScrollPosition && !this.settings.hideScrollbar) {
|
|
8784
|
+
$LG(window).scrollTop(this.prevScrollTop);
|
|
8785
|
+
}
|
|
8786
|
+
|
|
8747
8787
|
var currentItem = this.items[this.index];
|
|
8748
8788
|
var transform;
|
|
8749
8789
|
|
|
@@ -8789,7 +8829,10 @@ var lightgallery_LightGallery = /*#__PURE__*/function () {
|
|
|
8789
8829
|
_this28.outer.removeClass('lg-zoom-from-image');
|
|
8790
8830
|
}
|
|
8791
8831
|
|
|
8792
|
-
_this28.$container.removeClass('lg-show'); //
|
|
8832
|
+
_this28.$container.removeClass('lg-show'); // Reset scrollbar
|
|
8833
|
+
|
|
8834
|
+
|
|
8835
|
+
_this28.resetScrollBar(); // Need to remove inline opacity as it is used in the stylesheet as well
|
|
8793
8836
|
|
|
8794
8837
|
|
|
8795
8838
|
_this28.$backdrop.removeAttr('style').css('transition-duration', _this28.settings.backdropDuration + 'ms');
|