Enable strict mode and fix two scope errors
This commit is contained in:
parent
77dfdb9e1d
commit
947fc903fa
|
@ -1,5 +1,5 @@
|
||||||
/**
|
/**
|
||||||
* Springy v1.1.0
|
* Springy v1.1.1
|
||||||
*
|
*
|
||||||
* Copyright (c) 2010 Dennis Hotson
|
* Copyright (c) 2010 Dennis Hotson
|
||||||
*
|
*
|
||||||
|
@ -25,6 +25,9 @@
|
||||||
* OTHER DEALINGS IN THE SOFTWARE.
|
* OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// Enable strict mode for EC5 compatible browsers
|
||||||
|
"use strict";
|
||||||
|
|
||||||
var Graph = function() {
|
var Graph = function() {
|
||||||
this.nodeSet = {};
|
this.nodeSet = {};
|
||||||
this.nodes = [];
|
this.nodes = [];
|
||||||
|
@ -74,7 +77,7 @@ Graph.prototype.addNodes = function() {
|
||||||
// is a string that becomes both node identifier and label
|
// is a string that becomes both node identifier and label
|
||||||
for (var i = 0; i < arguments.length; i++) {
|
for (var i = 0; i < arguments.length; i++) {
|
||||||
var name = arguments[i];
|
var name = arguments[i];
|
||||||
var node = new Node(name, data = {label:name});
|
var node = new Node(name, {label:name});
|
||||||
this.addNode(node);
|
this.addNode(node);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -493,7 +496,7 @@ Layout.ForceDirected.prototype.getBoundingBox = function() {
|
||||||
|
|
||||||
|
|
||||||
// Vector
|
// Vector
|
||||||
Vector = function(x, y) {
|
var Vector = function(x, y) {
|
||||||
this.x = x;
|
this.x = x;
|
||||||
this.y = y;
|
this.y = y;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue
Block a user