Skip to content
This repository has been archived by the owner on Sep 6, 2022. It is now read-only.

Commit

Permalink
initialize gecko static picture fix on dom ready
Browse files Browse the repository at this point in the history
  • Loading branch information
aFarkas committed Jun 24, 2015
1 parent 261d1d5 commit 5d4b85f
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/plugins/gecko-picture/pf.gecko-picture.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,20 @@
timer = setTimeout(findPictureImgs, 99);
};
var mq = window.matchMedia && matchMedia("(orientation: landscape)");
var init = function(){
onResize();

dummySrc.srcset = "data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==";
if (mq && mq.addListener) {
mq.addListener(onResize);
}
};

onResize();
dummySrc.srcset = "data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==";

if (mq && mq.addListener) {
mq.addListener(onResize);
if (/^[c|i]|d$/.test(document.readyState || "")) {
init();
} else {
document.addEventListener("DOMContentLoaded", init);
}

return onResize;
Expand Down

0 comments on commit 5d4b85f

Please sign in to comment.