Fix disappearing nodes 41/141/1
authorAndrew Kim <andrekim@cisco.com>
Fri, 12 Apr 2013 19:08:02 +0000 (12:08 -0700)
committerAndrew Kim <andrekim@cisco.com>
Fri, 12 Apr 2013 19:08:02 +0000 (12:08 -0700)
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 <andrekim@cisco.com>
opendaylight/web/root/src/main/resources/js/jit.js

index 0f9ef03304948dadcbaf6fc47db6fb21b6658eac..7cfc2009477af05e7c5d3deb5575207f6e8fa302 100644 (file)
@@ -6115,10 +6115,10 @@ var MultiNodeHelper = {
                                };
                        } else {
                                ctx.drawImage(img,pos.x-32,pos.y-32);
                                };
                        } 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;
                },
                '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);
                                };
                        } 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;
                },
                'contains': function(npos, pos) {
                        var width = 64, height = 45;