Skip to content

Commit

Permalink
Fix multiple issues with touchscreen monitors
Browse files Browse the repository at this point in the history
  • Loading branch information
sachinchoolur committed Aug 8, 2017
1 parent 73f13db commit b2d50a3
Show file tree
Hide file tree
Showing 16 changed files with 58 additions and 56 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "lightgallery",
"version": "1.5.0",
"version": "1.6.0",
"description": "A lightweight, customizable, modular, responsive, lightbox gallery plugin for jQuery.",
"main": [
"dist/js/lightgallery.min.js",
Expand Down
2 changes: 1 addition & 1 deletion dist/css/lg-fb-comment-box.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! lightgallery - v1.5.0 - 2017-07-16
/*! lightgallery - v1.6.0 - 2017-08-08
* http://sachinchoolur.github.io/lightGallery/
* Copyright (c) 2017 Sachin N; Licensed GPLv3 */
.lg-outer.fb-comments .lg-img-wrap, .lg-outer.fb-comments .lg-video-cont {
Expand Down
2 changes: 1 addition & 1 deletion dist/css/lg-transitions.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/css/lightgallery.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

39 changes: 20 additions & 19 deletions dist/js/lightgallery-all.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*! lightgallery - v1.5.0 - 2017-07-16
/*! lightgallery - v1.6.0 - 2017-08-08
* http://sachinchoolur.github.io/lightGallery/
* Copyright (c) 2017 Sachin N; Licensed GPLv3 */
/*! lightgallery - v1.5.0 - 2017-07-16
/*! lightgallery - v1.6.0 - 2017-08-08
* http://sachinchoolur.github.io/lightGallery/
* Copyright (c) 2017 Sachin N; Licensed GPLv3 */
(function (root, factory) {
Expand Down Expand Up @@ -1113,7 +1113,7 @@
var endCoords = 0;
var isMoved = false;

if (_this.s.enableSwipe && _this.isTouch && _this.doCss()) {
if (_this.s.enableSwipe && _this.doCss()) {

_this.$slide.on('touchstart.lg', function(e) {
if (!_this.$outer.hasClass('lg-zoomed') && !_this.lgBusy) {
Expand Down Expand Up @@ -1152,7 +1152,7 @@
var endCoords = 0;
var isDraging = false;
var isMoved = false;
if (_this.s.enableDrag && !_this.isTouch && _this.doCss()) {
if (_this.s.enableDrag && _this.doCss()) {
_this.$slide.on('mousedown.lg', function(e) {
// execute only on .lg-object
if (!_this.$outer.hasClass('lg-zoomed')) {
Expand Down Expand Up @@ -1795,7 +1795,7 @@

}));

/*! lg-thumbnail - v1.0.3 - 2017-02-05
/*! lg-thumbnail - v1.1.0 - 2017-08-08
* http://sachinchoolur.github.io/lightGallery
* Copyright (c) 2017 Sachin N; Licensed GPLv3 */

Expand Down Expand Up @@ -1826,6 +1826,7 @@
currentPagerPosition: 'middle',

thumbWidth: 100,
thumbHeight: '80px',
thumbContHeight: 100,
thumbMargin: 5,

Expand Down Expand Up @@ -1861,6 +1862,10 @@
this.thumbTotalWidth = (this.core.$items.length * (this.core.s.thumbWidth + this.core.s.thumbMargin));
this.thumbIndex = this.core.index;

if (this.core.s.animateThumb) {
this.core.s.thumbHeight = '100%';
}

// Thumbnail animation value
this.left = 0;

Expand All @@ -1883,12 +1888,12 @@
}

this.build();
if (this.core.s.animateThumb) {
if (this.core.s.enableThumbDrag && !this.core.isTouch && this.core.doCss()) {
if (this.core.s.animateThumb && this.core.doCss()) {
if (this.core.s.enableThumbDrag) {
this.enableThumbDrag();
}

if (this.core.s.enableThumbSwipe && this.core.isTouch && this.core.doCss()) {
if (this.core.s.enableThumbSwipe) {
this.enableThumbSwipe();
}

Expand Down Expand Up @@ -1971,7 +1976,7 @@
thumbImg = thumb;
}

thumbList += '<div data-vimeo-id="' + vimeoId + '" class="lg-thumb-item" style="width:' + _this.core.s.thumbWidth + 'px; margin-right: ' + _this.core.s.thumbMargin + 'px"><img src="' + thumbImg + '" /></div>';
thumbList += '<div data-vimeo-id="' + vimeoId + '" class="lg-thumb-item" style="width:' + _this.core.s.thumbWidth + 'px; height: ' + _this.core.s.thumbHeight + '; margin-right: ' + _this.core.s.thumbMargin + 'px"><img src="' + thumbImg + '" /></div>';
vimeoId = '';
}

Expand Down Expand Up @@ -2269,7 +2274,7 @@

}));

/*! lg-video - v1.0.2 - 2017-06-04
/*! lg-video - v1.1.0 - 2017-08-08
* http://sachinchoolur.github.io/lightGallery
* Copyright (c) 2017 Sachin N; Licensed GPLv3 */

Expand Down Expand Up @@ -2444,7 +2449,7 @@
}
};

if (_this.core.doCss() && _this.core.$items.length > 1 && ((_this.core.s.enableSwipe && _this.core.isTouch) || (_this.core.s.enableDrag && !_this.core.isTouch))) {
if (_this.core.doCss() && (_this.core.$items.length > 1) && (_this.core.s.enableSwipe || _this.core.s.enableDrag)) {
_this.core.$el.on('onSlideClick.lg.tm', function() {
var $el = _this.core.$slide.eq(_this.core.index);
loadOnClick($el);
Expand Down Expand Up @@ -2587,9 +2592,9 @@

}));

/*! lg-zoom - v1.0.4 - 2016-12-20
/*! lg-zoom - v1.1.0 - 2017-08-08
* http://sachinchoolur.github.io/lightGallery
* Copyright (c) 2016 Sachin N; Licensed GPLv3 */
* Copyright (c) 2017 Sachin N; Licensed GPLv3 */

(function (root, factory) {
if (typeof define === 'function' && define.amd) {
Expand Down Expand Up @@ -2831,13 +2836,9 @@
});

// Drag option after zoom
if (!_this.core.isTouch) {
_this.zoomDrag();
}
_this.zoomDrag();

if (_this.core.isTouch) {
_this.zoomSwipe();
}
_this.zoomSwipe();

};

Expand Down
6 changes: 3 additions & 3 deletions dist/js/lightgallery-all.min.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions dist/js/lightgallery.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! lightgallery - v1.5.0 - 2017-07-16
/*! lightgallery - v1.6.0 - 2017-08-08
* http://sachinchoolur.github.io/lightGallery/
* Copyright (c) 2017 Sachin N; Licensed GPLv3 */
(function (root, factory) {
Expand Down Expand Up @@ -1110,7 +1110,7 @@
var endCoords = 0;
var isMoved = false;

if (_this.s.enableSwipe && _this.isTouch && _this.doCss()) {
if (_this.s.enableSwipe && _this.doCss()) {

_this.$slide.on('touchstart.lg', function(e) {
if (!_this.$outer.hasClass('lg-zoomed') && !_this.lgBusy) {
Expand Down Expand Up @@ -1149,7 +1149,7 @@
var endCoords = 0;
var isDraging = false;
var isMoved = false;
if (_this.s.enableDrag && !_this.isTouch && _this.doCss()) {
if (_this.s.enableDrag && _this.doCss()) {
_this.$slide.on('mousedown.lg', function(e) {
// execute only on .lg-object
if (!_this.$outer.hasClass('lg-zoomed')) {
Expand Down
4 changes: 2 additions & 2 deletions dist/js/lightgallery.min.js

Large diffs are not rendered by default.

15 changes: 10 additions & 5 deletions modules/lg-thumbnail.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! lg-thumbnail - v1.0.3 - 2017-02-05
/*! lg-thumbnail - v1.1.0 - 2017-08-08
* http://sachinchoolur.github.io/lightGallery
* Copyright (c) 2017 Sachin N; Licensed GPLv3 */

Expand Down Expand Up @@ -29,6 +29,7 @@
currentPagerPosition: 'middle',

thumbWidth: 100,
thumbHeight: '80px',
thumbContHeight: 100,
thumbMargin: 5,

Expand Down Expand Up @@ -64,6 +65,10 @@
this.thumbTotalWidth = (this.core.$items.length * (this.core.s.thumbWidth + this.core.s.thumbMargin));
this.thumbIndex = this.core.index;

if (this.core.s.animateThumb) {
this.core.s.thumbHeight = '100%';
}

// Thumbnail animation value
this.left = 0;

Expand All @@ -86,12 +91,12 @@
}

this.build();
if (this.core.s.animateThumb) {
if (this.core.s.enableThumbDrag && !this.core.isTouch && this.core.doCss()) {
if (this.core.s.animateThumb && this.core.doCss()) {
if (this.core.s.enableThumbDrag) {
this.enableThumbDrag();
}

if (this.core.s.enableThumbSwipe && this.core.isTouch && this.core.doCss()) {
if (this.core.s.enableThumbSwipe) {
this.enableThumbSwipe();
}

Expand Down Expand Up @@ -174,7 +179,7 @@
thumbImg = thumb;
}

thumbList += '<div data-vimeo-id="' + vimeoId + '" class="lg-thumb-item" style="width:' + _this.core.s.thumbWidth + 'px; margin-right: ' + _this.core.s.thumbMargin + 'px"><img src="' + thumbImg + '" /></div>';
thumbList += '<div data-vimeo-id="' + vimeoId + '" class="lg-thumb-item" style="width:' + _this.core.s.thumbWidth + 'px; height: ' + _this.core.s.thumbHeight + '; margin-right: ' + _this.core.s.thumbMargin + 'px"><img src="' + thumbImg + '" /></div>';
vimeoId = '';
}

Expand Down
Loading

0 comments on commit b2d50a3

Please sign in to comment.