removed Global namespace. global stuff is now just global, inside the Kinetic namespace. There was no reason to have a secondary level for global vars

This commit is contained in:
Eric Rowell
2013-09-08 22:02:04 -07:00
parent 400fae734d
commit c40fc7cf38
11 changed files with 97 additions and 111 deletions

View File

@@ -4,9 +4,16 @@
<title>KineticJS Mocha Tests</title>
<link rel="stylesheet" href="../node_modules/mocha/mocha.css" />
<style>
#mocha {
margin-top: 20px;
}
#mocha .test {
overflow: auto;
}
h1 {
font-family: Calibri;
margin-left: 10px;
}
h2.kinetic-title {
font-family: Calibri;
font-size: 16px;
@@ -17,6 +24,7 @@
</style>
</head>
<body>
<h1>KineticJS Test</h1>
<div id="mocha"></div>
<div id="kinetic-container"></div>

View File

@@ -2293,8 +2293,6 @@ suite('Node', function() {
id: 'myCircle'
});
var go = Kinetic.Global;
layer.add(circle);
var node = stage.get('#myCircle')[0];
@@ -2511,30 +2509,29 @@ suite('Node', function() {
var circleColorKey = circle.colorKey;
var rectColorKey = rect.colorKey;
var go = Kinetic.Global;
layer.add(circle);
layer.add(rect);
stage.add(layer);
assert.equal(go.ids.myCircle2._id, circle._id);
assert.equal(go.names.myRect2[0]._id, rect._id);
assert.equal(Kinetic.Global.shapes[circleColorKey]._id, circle._id);
assert.equal(Kinetic.Global.shapes[rectColorKey]._id, rect._id);
assert.equal(Kinetic.ids.myCircle2._id, circle._id);
assert.equal(Kinetic.names.myRect2[0]._id, rect._id);
assert.equal(Kinetic.shapes[circleColorKey]._id, circle._id);
assert.equal(Kinetic.shapes[rectColorKey]._id, rect._id);
circle.destroy();
assert.equal(go.ids.myCircle2, undefined);
assert.equal(go.names.myRect2[0]._id, rect._id);
assert.equal(Kinetic.Global.shapes[circleColorKey], undefined);
assert.equal(Kinetic.Global.shapes[rectColorKey]._id, rect._id);
assert.equal(Kinetic.ids.myCircle2, undefined);
assert.equal(Kinetic.names.myRect2[0]._id, rect._id);
assert.equal(Kinetic.shapes[circleColorKey], undefined);
assert.equal(Kinetic.shapes[rectColorKey]._id, rect._id);
rect.destroy();
assert.equal(go.ids.myCircle2, undefined);
assert.equal(go.names.myRect2, undefined);
assert.equal(Kinetic.Global.shapes[circleColorKey], undefined);
assert.equal(Kinetic.Global.shapes[rectColorKey], undefined);
assert.equal(Kinetic.ids.myCircle2, undefined);
assert.equal(Kinetic.names.myRect2, undefined);
assert.equal(Kinetic.shapes[circleColorKey], undefined);
assert.equal(Kinetic.shapes[rectColorKey], undefined);
});
// ======================================================