diff --git a/bower.json b/bower.json index e9c4923..bbcf506 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "lg-hash", - "version": "1.0.3", + "version": "1.0.4", "description": "History(Hash) module for lightgallery.", "main": [ "dist/lg-hash.min.js" diff --git a/dist/lg-hash.js b/dist/lg-hash.js index 4838792..13e9397 100644 --- a/dist/lg-hash.js +++ b/dist/lg-hash.js @@ -1,4 +1,4 @@ -/*! lg-hash - v1.0.3 - 2017-10-19 +/*! lg-hash - v1.0.4 - 2017-12-20 * http://sachinchoolur.github.io/lightGallery * Copyright (c) 2017 Sachin N; Licensed GPLv3 */ @@ -47,7 +47,7 @@ // Change hash value on after each slide transition _this.core.$el.on('onAfterSlide.lg.tm', function(event, prevIndex, index) { if (history.replaceState) { - history.replaceState(null, null, window.location.pathname + '#lg=' + _this.core.s.galleryId + '&slide=' + index); + history.replaceState(null, null, window.location.pathname + window.location.search + '#lg=' + _this.core.s.galleryId + '&slide=' + index); } else { window.location.hash = 'lg=' + _this.core.s.galleryId + '&slide=' + index; } diff --git a/dist/lg-hash.min.js b/dist/lg-hash.min.js index 3c8bcb4..a4bdcbd 100644 --- a/dist/lg-hash.min.js +++ b/dist/lg-hash.min.js @@ -1,4 +1,4 @@ -/*! lg-hash - v1.0.3 - 2017-10-19 +/*! lg-hash - v1.0.4 - 2017-12-20 * http://sachinchoolur.github.io/lightGallery * Copyright (c) 2017 Sachin N; Licensed GPLv3 */ -!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof exports?module.exports=b(require("jquery")):b(jQuery)}(this,function(a){!function(){"use strict";var b={hash:!0},c=function(c){return this.core=a(c).data("lightGallery"),this.core.s=a.extend({},b,this.core.s),this.core.s.hash&&(this.oldHash=window.location.hash,this.init()),this};c.prototype.init=function(){var b,c=this;c.core.$el.on("onAfterSlide.lg.tm",function(a,b,d){history.replaceState?history.replaceState(null,null,window.location.pathname+"#lg="+c.core.s.galleryId+"&slide="+d):window.location.hash="lg="+c.core.s.galleryId+"&slide="+d}),a(window).on("hashchange.lg.hash",function(){b=window.location.hash;var a=parseInt(b.split("&slide=")[1],10);b.indexOf("lg="+c.core.s.galleryId)>-1?c.core.slide(a,!1,!1):c.core.lGalleryOn&&c.core.destroy()})},c.prototype.destroy=function(){this.core.s.hash&&(this.oldHash&&this.oldHash.indexOf("lg="+this.core.s.galleryId)<0?history.replaceState?history.replaceState(null,null,this.oldHash):window.location.hash=this.oldHash:history.replaceState?history.replaceState(null,document.title,window.location.pathname+window.location.search):window.location.hash="",this.core.$el.off(".lg.hash"))},a.fn.lightGallery.modules.hash=c}()}); \ No newline at end of file +!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof exports?module.exports=b(require("jquery")):b(jQuery)}(this,function(a){!function(){"use strict";var b={hash:!0},c=function(c){return this.core=a(c).data("lightGallery"),this.core.s=a.extend({},b,this.core.s),this.core.s.hash&&(this.oldHash=window.location.hash,this.init()),this};c.prototype.init=function(){var b,c=this;c.core.$el.on("onAfterSlide.lg.tm",function(a,b,d){history.replaceState?history.replaceState(null,null,window.location.pathname+window.location.search+"#lg="+c.core.s.galleryId+"&slide="+d):window.location.hash="lg="+c.core.s.galleryId+"&slide="+d}),a(window).on("hashchange.lg.hash",function(){b=window.location.hash;var a=parseInt(b.split("&slide=")[1],10);b.indexOf("lg="+c.core.s.galleryId)>-1?c.core.slide(a,!1,!1):c.core.lGalleryOn&&c.core.destroy()})},c.prototype.destroy=function(){this.core.s.hash&&(this.oldHash&&this.oldHash.indexOf("lg="+this.core.s.galleryId)<0?history.replaceState?history.replaceState(null,null,this.oldHash):window.location.hash=this.oldHash:history.replaceState?history.replaceState(null,document.title,window.location.pathname+window.location.search):window.location.hash="",this.core.$el.off(".lg.hash"))},a.fn.lightGallery.modules.hash=c}()}); \ No newline at end of file diff --git a/package.json b/package.json index 3dc2ad9..fa1b76b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "lg-hash", - "version": "1.0.3", + "version": "1.0.4", "description": "History(Hash) module for lightgallery.", "keywords": [ "gallery",