Changeset View
Changeset View
Standalone View
Standalone View
webroot/rsrc/externals/javelin/core/Event.js
Show First 20 Lines • Show All 320 Lines • ▼ Show 20 Lines | properties : { | ||||
/** | /** | ||||
* @task info | * @task info | ||||
*/ | */ | ||||
nodes : {}, | nodes : {}, | ||||
/** | /** | ||||
* @task info | * @task info | ||||
*/ | */ | ||||
nodeDistances : {} | nodeDistances : {}, | ||||
/** | |||||
* True if this is a cursor event that was caused by a touch interaction | |||||
* rather than a mouse device interaction. | |||||
* | |||||
* @type bool | |||||
* @taks info | |||||
*/ | |||||
isTouchEvent: false | |||||
}, | }, | ||||
/** | /** | ||||
* @{class:JX.Event} installs a toString() method in ##__DEV__## which allows | * @{class:JX.Event} installs a toString() method in ##__DEV__## which allows | ||||
* you to log or print events and get a reasonable representation of them: | * you to log or print events and get a reasonable representation of them: | ||||
* | * | ||||
* Event<'click', ['path', 'stuff'], [object HTMLDivElement]> | * Event<'click', ['path', 'stuff'], [object HTMLDivElement]> | ||||
*/ | */ | ||||
initialize : function() { | initialize : function() { | ||||
if (__DEV__) { | if (__DEV__) { | ||||
JX.Event.prototype.toString = function() { | JX.Event.prototype.toString = function() { | ||||
var path = '['+this.getPath().join(', ')+']'; | var path = '['+this.getPath().join(', ')+']'; | ||||
return 'Event<'+this.getType()+', '+path+', '+this.getTarget()+'>'; | |||||
var type = this.getType(); | |||||
if (this.getIsTouchEvent()) { | |||||
type = type + '/touch'; | |||||
} | |||||
return 'Event<'+type+', '+path+', '+this.getTarget()+'>'; | |||||
}; | }; | ||||
} | } | ||||
} | } | ||||
}); | }); |