Permalink
Browse files

fix when loading zoomoz before html exists

If used on a chrome extension with "run_at" : "document_start", there
were a couple spots in the code that assumed that the html existed
already. Moved that code to document.ready
  • Loading branch information...
zmandel committed Apr 23, 2015
1 parent 01bd517 commit e73e405463558e0218dca4dc118c6a0a7d8c8041
Showing with 7 additions and 9 deletions.
  1. +2 −2 src/js/jquery.zoomooz-core.js
  2. +3 −4 src/js/jquery.zoomooz-zoomContainer.js
  3. +2 −3 src/js/jquery.zoomooz-zoomTarget.js
@@ -169,9 +169,9 @@
".noScroll{overflow:hidden !important;}" +
"* {"+transformOrigin+"}";
document.getElementsByTagName('head')[0].appendChild(style);
$(document).ready(function() {
$(document).ready(function () {
document.getElementsByTagName('head')[0].appendChild(style);
var scrollBarWidth = window.innerWidth - $("body").width();
style.innerHTML += "body.noScroll,html.noScroll body{margin-right:"+scrollBarWidth+"px;}";
});
@@ -41,11 +41,10 @@
//*** Static setup ***//
//**********************************//
// FIXME: move zoomContainer styling here?
//setupCssStyles();
// make all elements with the zoomContainer class zooming containers
$(document).ready(function() {
$(document).ready(function () {
// FIXME: move zoomContainer styling here?
//setupCssStyles();
// this needs to be after the "$.fn.zoomContainer" has been initialized
$(".zoomContainer").zoomContainer();
});
@@ -129,10 +129,9 @@
//*** Static setup ***//
//**********************************//
setupCssStyles();
// make all elements with the zoomTarget class zooming
$(document).ready(function() {
$(document).ready(function () {
setupCssStyles();
// this needs to be after the "$.fn.zoomTarget" has been initialized
$(".zoomTarget").zoomTarget();
});

0 comments on commit e73e405

Please sign in to comment.