Skip to content

Commit

Permalink
Bug fix sachinchoolur#9
Browse files Browse the repository at this point in the history
  • Loading branch information
sachinchoolur committed Aug 4, 2016
1 parent 481dcf8 commit 6230e89
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 12 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.js",
"version": "0.0.1",
"version": "0.0.2",
"description": "Full featured lightbox gallery. Zero dependencies",
"main": [
"dist/js/lightgallery.min.js",
Expand Down
Binary file modified dist/img/loading.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified dist/img/video-play.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified dist/img/vimeo-play.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified dist/img/youtube-play.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 5 additions & 4 deletions dist/js/lightgallery.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**!
* lightgallery.js | 0.0.1 | August 2nd 2016
* lightgallery.js | 0.0.2 | August 4th 2016
* http://sachinchoolur.github.io/lightGallery/
* Copyright (c) 2016 Sachin N;
* @license Apache 2.0
Expand Down Expand Up @@ -576,7 +576,7 @@
}

// Store the current scroll top value to scroll back after closing the gallery..
this.prevScrollTop = document.body.scrollTop;
this.prevScrollTop = document.documentElement.scrollTop || document.body.scrollTop;
};

// For fixed height gallery
Expand Down Expand Up @@ -1327,7 +1327,7 @@
if (!_lgUtils2.default.hasClass(_this.outer, 'lg-zoomed') && !_this.lgBusy) {
e.preventDefault();
_this.manageSwipeClass();
startCoords = e.originalEvent.targetTouches[0].pageX;
startCoords = e.targetTouches[0].pageX;
}
});
}
Expand All @@ -1337,7 +1337,7 @@
_lgUtils2.default.on(_this.___slide[j], 'touchmove.lg', function (e) {
if (!_lgUtils2.default.hasClass(_this.outer, 'lg-zoomed')) {
e.preventDefault();
endCoords = e.originalEvent.targetTouches[0].pageX;
endCoords = e.targetTouches[0].pageX;
_this.touchMove(startCoords, endCoords);
isMoved = true;
}
Expand Down Expand Up @@ -1507,6 +1507,7 @@
}

document.body.scrollTop = _this.prevScrollTop;
document.documentElement.scrollTop = _this.prevScrollTop;

/**
* if d is false or undefined destroy will only close the gallery
Expand Down
4 changes: 2 additions & 2 deletions dist/js/lightgallery.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "lightgallery.js",
"version": "0.0.1",
"version": "0.0.2",
"description": "Full featured lightbox gallery. Zero dependencies",
"keywords": [
"gallery",
Expand Down Expand Up @@ -55,7 +55,7 @@
"build-debug": "browserify src/js/lightgallery.js -s Lightgallery -t [babelify] -p [bannerify --file .banner ] -o dist/js/lightgallery.js",
"build-min": "uglifyjs dist/js/lightgallery.js --comments '/!/' -m screw_ie8=true -c screw_ie8=true,unused=false -o dist/js/lightgallery.min.js",
"watch": "watchify src/js/lightgallery.js -s Lightgallery -t [babelify] -o dist/js/lightgallery.js -v",
"dev": "watchify src/js/lightgallery.js -s Lightgallery -t [babelify] -o ../../lightgallery.js/lightgallery/js/lightgallery.js -v",
"dev": "watchify src/js/lightgallery.js -s Lightgallery -t [babelify] -o ../lg/lightgallery.js/lightgallery/js/lightgallery.js -v",
"css": "cleancss -o dist/css/lightgallery.min.css dist/css/lightgallery.css && cleancss -o dist/css/lg-fb-comment-box.min.css dist/css/lg-fb-comment-box.css && cleancss -o dist/css/lg-transitions.min.css dist/css/lg-transitions.css",
"copyfiles": "copyfiles -u 1 ./src/fonts/** dist && copyfiles -u 1 ./src/img/** dist && copyfiles -u 1 ./src/css/** dist",
"lint": "jshint src",
Expand Down
7 changes: 4 additions & 3 deletions src/js/lightgallery.js
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ Plugin.prototype.structure = function() {
}

// Store the current scroll top value to scroll back after closing the gallery..
this.prevScrollTop = document.body.scrollTop;
this.prevScrollTop = (document.documentElement.scrollTop || document.body.scrollTop)

};

Expand Down Expand Up @@ -1141,7 +1141,7 @@ Plugin.prototype.enableSwipe = function() {
if (!utils.hasClass(_this.outer, 'lg-zoomed') && !_this.lgBusy) {
e.preventDefault();
_this.manageSwipeClass();
startCoords = e.originalEvent.targetTouches[0].pageX;
startCoords = e.targetTouches[0].pageX;
}
});
}
Expand All @@ -1151,7 +1151,7 @@ Plugin.prototype.enableSwipe = function() {
utils.on(_this.___slide[j], 'touchmove.lg', function(e) {
if (!utils.hasClass(_this.outer, 'lg-zoomed')) {
e.preventDefault();
endCoords = e.originalEvent.targetTouches[0].pageX;
endCoords = e.targetTouches[0].pageX;
_this.touchMove(startCoords, endCoords);
isMoved = true;
}
Expand Down Expand Up @@ -1329,6 +1329,7 @@ Plugin.prototype.destroy = function(d) {
}

document.body.scrollTop = _this.prevScrollTop;
document.documentElement.scrollTop = _this.prevScrollTop;

/**
* if d is false or undefined destroy will only close the gallery
Expand Down

0 comments on commit 6230e89

Please sign in to comment.