From 79c84d74b6c78f3a4537d31c10619965e0153c24 Mon Sep 17 00:00:00 2001 From: Michael Winter Date: Thu, 13 Feb 2020 23:42:10 +0000 Subject: [PATCH] galleries almost set --- public/javascripts/global.js | 38 ++++++++++++++++++++++++++---------- routes/index.js | 13 +++++++++++- 2 files changed, 40 insertions(+), 11 deletions(-) diff --git a/public/javascripts/global.js b/public/javascripts/global.js index 05a25ed..402a288 100644 --- a/public/javascripts/global.js +++ b/public/javascripts/global.js @@ -18,7 +18,10 @@ $(document).ready(function() { populateAbout(); populateGallerySelector(); - } + if (window.location.href.split('/').pop().substring(0,3) != "#lg") { + window.history.replaceState("object or string", "Title", "/"); + } +} $( window ).resize(function() { resetDivHeights(); @@ -34,7 +37,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.history.pushState("object or string", "Title", this.getAttribute('data-target')); }); $(window).scroll(function(event) { @@ -353,22 +356,18 @@ function populatePieces(type) { documentButton.lightGallery({ selector: 'this', width: '90%', - //hash: false, - galleryId: 'score_viewer_'+index + 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); + window.history.replaceState(null, null, "/scores/" + score_data.filename); }); documentButton.on('onCloseAfter.lg', function(event, prevIndex, index){ - window.history.pushState("object or string", "Title", "/"); -//console.log("test"); + window.history.replaceState("object or string", "Title", "/"); }) } @@ -733,20 +732,39 @@ console.log(href); documentButton = $('