From eeb40ec4ccebd642f8b080dec674b87743d28c3e Mon Sep 17 00:00:00 2001 From: mrdrogdrog <tilman.vatteroth@udo.edu> Date: Thu, 2 Jul 2015 15:48:51 +0200 Subject: [PATCH] workaround because firefox is a bitch --- panels/clock/script.js | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/panels/clock/script.js b/panels/clock/script.js index e89c85c..bb536ae 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; } -- GitLab