From: Andrew Kim Date: Fri, 12 Apr 2013 19:08:02 +0000 (-0700) Subject: Fix disappearing nodes X-Git-Tag: releasepom-0.1.0~576 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=commitdiff_plain;h=304c00a75e11781c10ec62f9bf10c29fa13a559b Fix disappearing nodes Minor fix in jit.js, this bug was only seen in Webkit-based browsers such as Chrome/Chromium Change-Id: Ied1b2c68ce98d7d6b9385b9c2f3f56cf34ba8fed Signed-off-by: Andrew Kim --- diff --git a/opendaylight/web/root/src/main/resources/js/jit.js b/opendaylight/web/root/src/main/resources/js/jit.js index 0f9ef03304..7cfc200947 100644 --- a/opendaylight/web/root/src/main/resources/js/jit.js +++ b/opendaylight/web/root/src/main/resources/js/jit.js @@ -6115,10 +6115,10 @@ var MultiNodeHelper = { }; } else { ctx.drawImage(img,pos.x-32,pos.y-32); + img.onload = function() { + ctx.drawImage(img,pos.x-32,pos.y-32); + }; } - /*var width = 64, height = 55; - ctx.fillStyle = "rgba(0,0,0,0)"; - ctx.fillRect(pos.x - width / 2, pos.y - height / 2, width, height);*/ }, 'contains': function(npos, pos) { var width = 64, height = 55; @@ -6137,10 +6137,10 @@ var MultiNodeHelper = { }; } else { ctx.drawImage(img,pos.x-32,pos.y-32); + img.onload = function() { + ctx.drawImage(img,pos.x-32,pos.y-32); + }; } - /*var width = 64, height = 45; - ctx.fillStyle = "rgba(0,0,0,0)"; - ctx.fillRect(pos.x - width / 2, pos.y - height / 2, width, height);*/ }, 'contains': function(npos, pos) { var width = 64, height = 45;