Skip to content

Commit

Permalink
Fixes close button on portfolio and picture templates
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmerfield committed Apr 23, 2021
1 parent b974133 commit e0a0817
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
8 changes: 2 additions & 6 deletions app/templates/latest/picture/script.js
Expand Up @@ -26,17 +26,13 @@ function lastIndexPage () {

visitedPosts.slice().reverse().forEach(function(item, i) {

// console.log(backIndex, item.pathname, articles.indexOf(item.pathname));

if (backIndex === null && articles.indexOf(item.pathname) === -1) {
if (backIndex === null && articles.indexOf(decodeURIComponent(item.pathname)) === -1) {
backIndex = i;
return false;
}
});

// console.log('BACK INDEX', backIndex);

if (backIndex !== null)
if (backIndex !== null && backIndex !== 0)
window.history.go(-backIndex);
else
window.location = '/';
Expand Down
8 changes: 2 additions & 6 deletions app/templates/past/portfolio/script.js
Expand Up @@ -18,17 +18,13 @@ function lastIndexPage () {

visitedPosts.slice().reverse().forEach(function(item, i) {

// console.log(backIndex, item.pathname, articles.indexOf(item.pathname));

if (backIndex === null && articles.indexOf(item.pathname) === -1) {
if (backIndex === null && articles.indexOf(decodeURIComponent(item.pathname)) === -1) {
backIndex = i;
return false;
}
});

// console.log('BACK INDEX', backIndex);

if (backIndex !== null)
if (backIndex !== null && backIndex !== 0)
window.history.go(-backIndex);
else
window.location = '/';
Expand Down

0 comments on commit e0a0817

Please sign in to comment.