Load photoswipe by default and fix double-load bug

Photoswipe is now loaded by default for all pages in this theme. No need
to call load-photoswipe shortcode anymore. Fixes bug where
load-photoswipe.js was invoked multiple times, which caused the
photoswipe to prevent viewing the lightbox more than once.
This commit is contained in:
Michael Romero 2017-06-06 22:51:02 -07:00
commit bbeb127b30
6 changed files with 6 additions and 97 deletions

View file

@ -29,7 +29,7 @@ $( document ).ready(function() {
title : $title,
msrc : $msrc
};
console.log("Using pre-defined dimensions for " + $src);
//console.log("Using pre-defined dimensions for " + $src);
// if not, set temp default size then load the image to check actual size
} else {
var item = {
@ -39,7 +39,7 @@ $( document ).ready(function() {
title : $title,
msrc : $msrc
};
console.log("Using default dimensions for " + $src);
//console.log("Using default dimensions for " + $src);
// load the image to check its dimensions
// update the item as soon as w and h are known (check every 30ms)
var img = new Image();
@ -51,7 +51,7 @@ $( document ).ready(function() {
clearInterval(wait);
item.w = w;
item.h = h;
console.log("Got actual dimensions for " + img.src);
//console.log("Got actual dimensions for " + img.src);
}
}, 30);
}