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:
parent
f86398e399
commit
bbeb127b30
6 changed files with 6 additions and 97 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue