Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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 e73e405
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/js/jquery.zoomooz-core.js
Expand Up @@ -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;}";
});
Expand Down
7 changes: 3 additions & 4 deletions src/js/jquery.zoomooz-zoomContainer.js
Expand Up @@ -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();
});
Expand Down
5 changes: 2 additions & 3 deletions src/js/jquery.zoomooz-zoomTarget.js
Expand Up @@ -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();
});
Expand Down

0 comments on commit e73e405

Please sign in to comment.