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
|
@@ -5872,6 +5872,8 @@ var lightGalleryCoreSettings = {
|
|
|
5872
5872
|
defaultCaptionHeight: 0,
|
|
5873
5873
|
ariaLabelledby: '',
|
|
5874
5874
|
ariaDescribedby: '',
|
|
5875
|
+
resetScrollPosition: true,
|
|
5876
|
+
hideScrollbar: false,
|
|
5875
5877
|
closable: true,
|
|
5876
5878
|
swipeToClose: true,
|
|
5877
5879
|
closeOnTap: true,
|
|
@@ -6829,6 +6831,7 @@ var lightgallery_LightGallery = /*#__PURE__*/function () {
|
|
|
6829
6831
|
this.currentItemsInDom = []; // Scroll top value before lightGallery is opened
|
|
6830
6832
|
|
|
6831
6833
|
this.prevScrollTop = 0;
|
|
6834
|
+
this.bodyPaddingRight = 0;
|
|
6832
6835
|
this.isDummyImageRemoved = false;
|
|
6833
6836
|
this.dragOrSwipeEnabled = false;
|
|
6834
6837
|
this.mediaContainerPosition = {
|
|
@@ -7222,6 +7225,34 @@ var lightgallery_LightGallery = /*#__PURE__*/function () {
|
|
|
7222
7225
|
return this.settings.dynamicEl || [];
|
|
7223
7226
|
}
|
|
7224
7227
|
}
|
|
7228
|
+
}, {
|
|
7229
|
+
key: "shouldHideScrollbar",
|
|
7230
|
+
value: function shouldHideScrollbar() {
|
|
7231
|
+
return this.settings.hideScrollbar && document.body === this.settings.container;
|
|
7232
|
+
}
|
|
7233
|
+
}, {
|
|
7234
|
+
key: "hideScrollbar",
|
|
7235
|
+
value: function hideScrollbar() {
|
|
7236
|
+
if (!this.shouldHideScrollbar()) {
|
|
7237
|
+
return;
|
|
7238
|
+
}
|
|
7239
|
+
|
|
7240
|
+
this.bodyPaddingRight = parseFloat($LG('body').style().paddingRight);
|
|
7241
|
+
var bodyRect = document.documentElement.getBoundingClientRect();
|
|
7242
|
+
var scrollbarWidth = window.innerWidth - bodyRect.width;
|
|
7243
|
+
$LG(document.body).css('padding-right', scrollbarWidth + this.bodyPaddingRight + 'px');
|
|
7244
|
+
$LG(document.body).addClass('lg-overlay-open');
|
|
7245
|
+
}
|
|
7246
|
+
}, {
|
|
7247
|
+
key: "resetScrollBar",
|
|
7248
|
+
value: function resetScrollBar() {
|
|
7249
|
+
if (!this.shouldHideScrollbar()) {
|
|
7250
|
+
return;
|
|
7251
|
+
}
|
|
7252
|
+
|
|
7253
|
+
$LG(document.body).css('padding-right', this.bodyPaddingRight + 'px');
|
|
7254
|
+
$LG(document.body).removeClass('lg-overlay-open');
|
|
7255
|
+
}
|
|
7225
7256
|
/**
|
|
7226
7257
|
* Open lightGallery.
|
|
7227
7258
|
* Open gallery with specific slide by passing index of the slide as parameter.
|
|
@@ -7261,7 +7292,8 @@ var lightgallery_LightGallery = /*#__PURE__*/function () {
|
|
|
7261
7292
|
// prevent accidental double execution
|
|
7262
7293
|
if (this.lgOpened) return;
|
|
7263
7294
|
this.lgOpened = true;
|
|
7264
|
-
this.outer.removeClass('lg-hide-items');
|
|
7295
|
+
this.outer.removeClass('lg-hide-items');
|
|
7296
|
+
this.hideScrollbar(); // Add display block, but still has opacity 0
|
|
7265
7297
|
|
|
7266
7298
|
this.$container.addClass('lg-show');
|
|
7267
7299
|
var itemsToBeInsertedToDom = this.getItemsToBeInsertedToDom(index, index);
|
|
@@ -7775,7 +7807,9 @@ var lightgallery_LightGallery = /*#__PURE__*/function () {
|
|
|
7775
7807
|
if (!$currentSlide.hasClass('lg-loaded')) {
|
|
7776
7808
|
setTimeout(function () {
|
|
7777
7809
|
if (_this10.getSlideType(currentGalleryItem) === 'image') {
|
|
7778
|
-
|
|
7810
|
+
var alt = currentGalleryItem.alt;
|
|
7811
|
+
var altAttr = alt ? 'alt="' + alt + '"' : '';
|
|
7812
|
+
$currentSlide.find('.lg-img-wrap').append(lg_utils.getImgMarkup(index, src, altAttr, srcset, sizes, currentGalleryItem.sources));
|
|
7779
7813
|
|
|
7780
7814
|
if (srcset || sources) {
|
|
7781
7815
|
var _$img = $currentSlide.find('.lg-object');
|
|
@@ -8664,7 +8698,9 @@ var lightgallery_LightGallery = /*#__PURE__*/function () {
|
|
|
8664
8698
|
value: function trapFocus() {
|
|
8665
8699
|
var _this26 = this;
|
|
8666
8700
|
|
|
8667
|
-
this.$container.get().focus(
|
|
8701
|
+
this.$container.get().focus({
|
|
8702
|
+
preventScroll: true
|
|
8703
|
+
});
|
|
8668
8704
|
$LG(window).on("keydown.lg.global".concat(this.lgId), function (e) {
|
|
8669
8705
|
if (!_this26.lgOpened) {
|
|
8670
8706
|
return;
|
|
@@ -8752,7 +8788,11 @@ var lightgallery_LightGallery = /*#__PURE__*/function () {
|
|
|
8752
8788
|
}
|
|
8753
8789
|
|
|
8754
8790
|
this.LGel.trigger(lGEvents.beforeClose);
|
|
8755
|
-
|
|
8791
|
+
|
|
8792
|
+
if (this.settings.resetScrollPosition && !this.settings.hideScrollbar) {
|
|
8793
|
+
$LG(window).scrollTop(this.prevScrollTop);
|
|
8794
|
+
}
|
|
8795
|
+
|
|
8756
8796
|
var currentItem = this.items[this.index];
|
|
8757
8797
|
var transform;
|
|
8758
8798
|
|
|
@@ -8798,7 +8838,10 @@ var lightgallery_LightGallery = /*#__PURE__*/function () {
|
|
|
8798
8838
|
_this28.outer.removeClass('lg-zoom-from-image');
|
|
8799
8839
|
}
|
|
8800
8840
|
|
|
8801
|
-
_this28.$container.removeClass('lg-show'); //
|
|
8841
|
+
_this28.$container.removeClass('lg-show'); // Reset scrollbar
|
|
8842
|
+
|
|
8843
|
+
|
|
8844
|
+
_this28.resetScrollBar(); // Need to remove inline opacity as it is used in the stylesheet as well
|
|
8802
8845
|
|
|
8803
8846
|
|
|
8804
8847
|
_this28.$backdrop.removeAttr('style').css('transition-duration', _this28.settings.backdropDuration + 'ms');
|