Skip to content

Commit

Permalink
Fixes missing js files
Browse files Browse the repository at this point in the history
  • Loading branch information
Arinas committed Feb 18, 2020
1 parent 4647cce commit db5c224
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 10 deletions.
22 changes: 15 additions & 7 deletions dist/simple-lightbox.jquery.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ function () {
throttleInterval: 0,
doubleTapZoom: 2,
maxZoom: 10,
htmlClass: 'has-lightbox'
htmlClass: 'has-lightbox',
rtl: false
});

_defineProperty(this, "transitionPrefix", void 0);
Expand Down Expand Up @@ -237,10 +238,7 @@ function () {

if (!_this.isAnimating && ['ArrowLeft', 'ArrowRight'].indexOf(event.key) > -1) {
_this.loadImage(event.key === 'ArrowRight' ? 1 : -1);
} // if (['ArrowLeft', 'ArrowRight'].indexOf(event.key) > -1) {
// this.loadImage(event.key === 'ArrowRight' ? 1 : -1);
// }

}
}
}, this.options.throttleInterval));
}
Expand Down Expand Up @@ -281,6 +279,10 @@ function () {
if (this.options.className) {
this.domNodes.wrapper.classList.add(this.options.className);
}

if (this.options.rtl) {
this.domNodes.wrapper.classList.add('sl-dir-rtl');
}
}
}, {
key: "throttle",
Expand Down Expand Up @@ -428,6 +430,12 @@ function () {
value: function loadImage(direction) {
var _this4 = this;

var slideDirection = direction;

if (this.options.rtl) {
direction = -direction;
}

this.relatedElements[this.currentImageIndex].dispatchEvent(new Event('change.' + this.eventNamespace));
this.relatedElements[this.currentImageIndex].dispatchEvent(new Event((direction === 1 ? 'next' : 'prev') + '.' + this.eventNamespace));
var newIndex = this.currentImageIndex + direction;
Expand All @@ -440,7 +448,7 @@ function () {
this.domNodes.counter.querySelector('.sl-current').innerHTML = this.currentImageIndex + 1;

if (this.options.animationSlide) {
this.slide(this.options.animationSpeed / 1000, -100 * direction - this.controlCoordinates.swipeDiff + 'px');
this.slide(this.options.animationSpeed / 1000, -100 * slideDirection - this.controlCoordinates.swipeDiff + 'px');
}

this.fadeOut(this.domNodes.image, 300, function () {
Expand All @@ -458,7 +466,7 @@ function () {
_this4.domNodes.image.removeChild(_this4.domNodes.caption);
}

_this4.adjustImage(direction);
_this4.adjustImage(slideDirection);

if (_this4.options.preloading) _this4.preload();
}, 100);
Expand Down
Loading

0 comments on commit db5c224

Please sign in to comment.