diff --git a/panels/clock/script.js b/panels/clock/script.js index e89c85ca5dea4672e45e9f5a29268ea3632d09e3..bb536ae453363e268395199b2e87b5538da1b3c4 100755 --- a/panels/clock/script.js +++ b/panels/clock/script.js @@ -56,15 +56,15 @@ this.loaded = function(panel, config) { bigFontPost = "time-medium", // width * 43.75% smlFontPost = "time-medium"; // width * 18.75% - init = function() { - if (fontsReady) { + inita = function() { + if (window.fontsReady) { digiBackground = document.createElement('canvas'); analBackground = document.createElement('canvas'); me.resize($(panel).width(), $(panel).height()); loop(); } else { - setTimeout(init,0); + setTimeout(inita,0); } } @@ -74,8 +74,6 @@ this.loaded = function(panel, config) { } this.resize = function(width, height) { -console.log("width " + width); -console.log("height " + height); if (height > width) { var size = height / 2; if (!!analClock) { @@ -306,9 +304,8 @@ console.log("height " + height); abgc.drawImage(bc, -analogRad, -analogRad, analogRad * 2, analogRad * 2); } - analBGImg.onload = function() { - init(); + inita(); } analBGImg.src = analBGFile; }