updated global object utilities

This commit is contained in:
Eric Rowell 2012-06-21 12:47:15 -07:00
parent 5765ab749b
commit ac3f512ab8
4 changed files with 7 additions and 5 deletions

View File

@ -159,7 +159,7 @@ Kinetic.GlobalObject = {
} }
}, },
/* /*
* cherry-picked and modified utilities from underscore.js * cherry-picked utilities from underscore.js
*/ */
_isElement: function(obj) { _isElement: function(obj) {
return !!(obj && obj.nodeType == 1); return !!(obj && obj.nodeType == 1);
@ -171,6 +171,7 @@ Kinetic.GlobalObject = {
return Object.prototype.toString.call(obj) == '[object Array]'; return Object.prototype.toString.call(obj) == '[object Array]';
}, },
_isObject: function(obj) { _isObject: function(obj) {
//return obj === Object(obj);
return (obj !== undefined && obj.constructor == Object); return (obj !== undefined && obj.constructor == Object);
}, },
_isNumber: function(obj) { _isNumber: function(obj) {

File diff suppressed because one or more lines are too long

View File

@ -131,7 +131,7 @@ Kinetic.GlobalObject = {
} }
}, },
/* /*
* cherry-picked and modified utilities from underscore.js * cherry-picked utilities from underscore.js
*/ */
_isElement: function(obj) { _isElement: function(obj) {
return !!(obj && obj.nodeType == 1); return !!(obj && obj.nodeType == 1);
@ -143,6 +143,7 @@ Kinetic.GlobalObject = {
return Object.prototype.toString.call(obj) == '[object Array]'; return Object.prototype.toString.call(obj) == '[object Array]';
}, },
_isObject: function(obj) { _isObject: function(obj) {
//return obj === Object(obj);
return (obj !== undefined && obj.constructor == Object); return (obj !== undefined && obj.constructor == Object);
}, },
_isNumber: function(obj) { _isNumber: function(obj) {

View File

@ -390,7 +390,7 @@ Test.prototype.tests = {
layer.add(Ellipse); layer.add(Ellipse);
stage.add(layer); stage.add(layer);
}, },
'*EVENTS - move mouse from shape to another shape in same layer': function(containerId) { 'EVENTS - move mouse from shape to another shape in same layer': function(containerId) {
var stage = new Kinetic.Stage({ var stage = new Kinetic.Stage({
container: containerId, container: containerId,
width: 578, width: 578,