diff --git a/public/javascripts/global.js b/public/javascripts/global.js index 644475b..05a25ed 100644 --- a/public/javascripts/global.js +++ b/public/javascripts/global.js @@ -34,7 +34,7 @@ $(document).ready(function() { $('html, body').animate({ scrollTop: $(target).offset().top - 210 }, 500); - + window.history.pushState("object or string", "Title", this.getAttribute('data-target')); }); $(window).scroll(function(event) { @@ -353,9 +353,26 @@ function populatePieces(type) { documentButton.lightGallery({ selector: 'this', width: '90%', + //hash: false, galleryId: 'score_viewer_'+index }); + if(typeof doc != 'undefined'){ + } else{ + documentButton.on('onSlideItemLoad.lg', function(event, index){ + window.history.pushState(null, null, "/scores/" + score_data.filename); + //location.replace("/scores/" + score_data.filename); +//window.location.hash = "test"; +//console.log(window.location.hash); + }); + + documentButton.on('onCloseAfter.lg', function(event, prevIndex, index){ + window.history.pushState("object or string", "Title", "/"); +//console.log("test"); + }) + + } + } else { documentButton = $('