Fix typo "swtch" to "switch"
[controller.git] / opendaylight / web / root / src / main / resources / js / jit.js
index 0f9ef03304948dadcbaf6fc47db6fb21b6658eac..dce2d2f1556c7ff0b770cdc75584a24933005195 100644 (file)
@@ -4109,7 +4109,7 @@ $jit.MultiGraph = new Class({
 
          // add this adjacency into the current edges object
          adjsObj[obj2.id].push(adj);
-         if (adj.nodeFrom.data["$type"] != "swtch") {
+         if (adj.nodeFrom.data["$type"] != "switch") {
                // if this is not a switch (e.g. host), then add it to the switch because it will never be added by itself
                adjsObj2[obj.id].push(adj);
          }
@@ -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;
@@ -6126,7 +6126,7 @@ var MultiNodeHelper = {
                                && Math.abs(pos.y - npos.y) <= height / 2;
                }
        },
-       'swtch': {
+       'switch': {
                'render': function(pos, canvas, animating) {
                        var ctx = canvas.getCtx();
                        var img = new Image();
@@ -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;
@@ -9782,14 +9782,14 @@ $jit.MultiTopology.$extend = true;
                        return this.nodeHelper.host.contains(npos, pos);
                }
        },
-       'swtch': {
+       'switch': {
                'render': function(node, canvas, animating) {
                        var pos = node.pos.getc(true);
-                       this.nodeHelper.swtch.render(pos, canvas, animating);
+                       this.nodeHelper.switch.render(pos, canvas, animating);
                },
                'contains': function(node, pos) {
                        var npos = node.pos.getc(true);
-                       return this.nodeHelper.swtch.contains(npos, pos);
+                       return this.nodeHelper.switch.contains(npos, pos);
                }
        }
   });