lightgallery 2.5.0-beta.3 → 2.5.0-beta.4
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 +10 -0
- package/lib/lg-settings.js +2 -0
- package/lib/lg-settings.js.map +1 -1
- package/lib/lightgallery.js +31 -2
- package/lib/lightgallery.js.map +1 -1
- package/lightgallery.d.ts +4 -0
- package/lightgallery.es5.js +34 -3
- package/lightgallery.es5.js.map +1 -1
- package/lightgallery.min.js +2 -2
- package/lightgallery.umd.js +34 -3
- 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.es5.js +1 -1
- package/plugins/video/lg-video.min.js +1 -1
- package/plugins/video/lg-video.umd.js +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 +34 -3
- package/react/Lightgallery.es5.js.map +1 -1
- package/react/Lightgallery.umd.js +34 -3
- package/react/Lightgallery.umd.js.map +1 -1
- package/scss/lightgallery-core.scss +3 -0
- package/vue/LightGalleryVue.common.js +45 -4
- package/vue/LightGalleryVue.common.js.map +1 -1
- package/vue/LightGalleryVue.umd.js +45 -4
- 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
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lightgallery",
|
|
3
|
-
"version": "2.5.0-beta.
|
|
3
|
+
"version": "2.5.0-beta.4",
|
|
4
4
|
"description": "lightGallery is a feature-rich, modular JavaScript gallery plugin for building beautiful image and video galleries for the web and the mobile",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"JavaScript",
|
|
@@ -28,7 +28,7 @@ function __rest(s, e) {
|
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
/*!
|
|
31
|
-
* lightgallery | 2.5.0-beta.
|
|
31
|
+
* lightgallery | 2.5.0-beta.4 | May 9th 2022
|
|
32
32
|
* http://www.lightgalleryjs.com/
|
|
33
33
|
* Copyright (c) 2020 Sachin Neravath;
|
|
34
34
|
* @license GPLv3
|
|
@@ -125,6 +125,8 @@ var lightGalleryCoreSettings = {
|
|
|
125
125
|
defaultCaptionHeight: 0,
|
|
126
126
|
ariaLabelledby: '',
|
|
127
127
|
ariaDescribedby: '',
|
|
128
|
+
resetScrollPosition: true,
|
|
129
|
+
hideScrollbar: false,
|
|
128
130
|
closable: true,
|
|
129
131
|
swipeToClose: true,
|
|
130
132
|
closeOnTap: true,
|
|
@@ -861,6 +863,7 @@ var LightGallery = /** @class */ (function () {
|
|
|
861
863
|
this.currentItemsInDom = [];
|
|
862
864
|
// Scroll top value before lightGallery is opened
|
|
863
865
|
this.prevScrollTop = 0;
|
|
866
|
+
this.bodyPaddingRight = 0;
|
|
864
867
|
this.isDummyImageRemoved = false;
|
|
865
868
|
this.dragOrSwipeEnabled = false;
|
|
866
869
|
this.mediaContainerPosition = {
|
|
@@ -1208,6 +1211,27 @@ var LightGallery = /** @class */ (function () {
|
|
|
1208
1211
|
return this.settings.dynamicEl || [];
|
|
1209
1212
|
}
|
|
1210
1213
|
};
|
|
1214
|
+
LightGallery.prototype.shouldHideScrollbar = function () {
|
|
1215
|
+
return (this.settings.hideScrollbar &&
|
|
1216
|
+
document.body === this.settings.container);
|
|
1217
|
+
};
|
|
1218
|
+
LightGallery.prototype.hideScrollbar = function () {
|
|
1219
|
+
if (!this.shouldHideScrollbar()) {
|
|
1220
|
+
return;
|
|
1221
|
+
}
|
|
1222
|
+
this.bodyPaddingRight = parseFloat($LG('body').style().paddingRight);
|
|
1223
|
+
var bodyRect = document.documentElement.getBoundingClientRect();
|
|
1224
|
+
var scrollbarWidth = window.innerWidth - bodyRect.width;
|
|
1225
|
+
$LG(document.body).css('padding-right', scrollbarWidth + this.bodyPaddingRight + 'px');
|
|
1226
|
+
$LG(document.body).addClass('lg-overlay-open');
|
|
1227
|
+
};
|
|
1228
|
+
LightGallery.prototype.resetScrollBar = function () {
|
|
1229
|
+
if (!this.shouldHideScrollbar()) {
|
|
1230
|
+
return;
|
|
1231
|
+
}
|
|
1232
|
+
$LG(document.body).css('padding-right', this.bodyPaddingRight + 'px');
|
|
1233
|
+
$LG(document.body).removeClass('lg-overlay-open');
|
|
1234
|
+
};
|
|
1211
1235
|
/**
|
|
1212
1236
|
* Open lightGallery.
|
|
1213
1237
|
* Open gallery with specific slide by passing index of the slide as parameter.
|
|
@@ -1244,6 +1268,7 @@ var LightGallery = /** @class */ (function () {
|
|
|
1244
1268
|
return;
|
|
1245
1269
|
this.lgOpened = true;
|
|
1246
1270
|
this.outer.removeClass('lg-hide-items');
|
|
1271
|
+
this.hideScrollbar();
|
|
1247
1272
|
// Add display block, but still has opacity 0
|
|
1248
1273
|
this.$container.addClass('lg-show');
|
|
1249
1274
|
var itemsToBeInsertedToDom = this.getItemsToBeInsertedToDom(index, index);
|
|
@@ -2485,7 +2510,9 @@ var LightGallery = /** @class */ (function () {
|
|
|
2485
2510
|
};
|
|
2486
2511
|
LightGallery.prototype.trapFocus = function () {
|
|
2487
2512
|
var _this = this;
|
|
2488
|
-
this.$container.get().focus(
|
|
2513
|
+
this.$container.get().focus({
|
|
2514
|
+
preventScroll: true,
|
|
2515
|
+
});
|
|
2489
2516
|
$LG(window).on("keydown.lg.global" + this.lgId, function (e) {
|
|
2490
2517
|
if (!_this.lgOpened) {
|
|
2491
2518
|
return;
|
|
@@ -2561,7 +2588,9 @@ var LightGallery = /** @class */ (function () {
|
|
|
2561
2588
|
return 0;
|
|
2562
2589
|
}
|
|
2563
2590
|
this.LGel.trigger(lGEvents.beforeClose);
|
|
2564
|
-
|
|
2591
|
+
if (this.settings.resetScrollPosition && !this.settings.hideScrollbar) {
|
|
2592
|
+
$LG(window).scrollTop(this.prevScrollTop);
|
|
2593
|
+
}
|
|
2565
2594
|
var currentItem = this.items[this.index];
|
|
2566
2595
|
var transform;
|
|
2567
2596
|
if (this.zoomFromOrigin && currentItem) {
|
|
@@ -2606,6 +2635,8 @@ var LightGallery = /** @class */ (function () {
|
|
|
2606
2635
|
_this.outer.removeClass('lg-zoom-from-image');
|
|
2607
2636
|
}
|
|
2608
2637
|
_this.$container.removeClass('lg-show');
|
|
2638
|
+
// Reset scrollbar
|
|
2639
|
+
_this.resetScrollBar();
|
|
2609
2640
|
// Need to remove inline opacity as it is used in the stylesheet as well
|
|
2610
2641
|
_this.$backdrop
|
|
2611
2642
|
.removeAttr('style')
|