Browse files

fixed a couple of calls so that it has better performance and use the…

… internal cacheing.
  • Loading branch information...
1 parent d42a951 commit 6553c548640e46bf85c78f867c6a3cb452b9b0f8 @etgryphon etgryphon committed Feb 19, 2011
Showing with 2 additions and 4 deletions.
  1. +2 −4 frameworks/linkit/views/canvas.js
View
6 frameworks/linkit/views/canvas.js
@@ -123,8 +123,7 @@ LinkIt.CanvasView = SC.CollectionView.extend({
var ctx, ce, frame = this.get('frame');
if (firstTime && !SC.browser.msie) {
- context.push('<canvas class="base-layer" width="%@" height="%@">You can\'t use canvas tags</canvas>'.fmt(frame.width, frame.height));
- this._canvasContext = null;
+ context.push('<canvas class="base-layer" width="%@" height="%@"></canvas>'.fmt(frame.width, frame.height));
}
this.invokeOnce('updateCanvas');
@@ -431,7 +430,6 @@ LinkIt.CanvasView = SC.CollectionView.extend({
/**
*/
_drawLinks: function(context) {
- if (!this._links) return;
var links = this._links;
var numLinks = links.get('length');
var link, points, i, linkID;
@@ -536,7 +534,7 @@ LinkIt.CanvasView = SC.CollectionView.extend({
var nodes = this.get('content');
var numNodes = 0;
var node, nodeID;
- this._nodeIndex = {};
+ this._nodeIndex = this._nodeIndex || {};
if (nodes) {
numNodes = nodes.get('length');
for (var i = 0; i < numNodes; i++) {

0 comments on commit 6553c54

Please sign in to comment.