mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-08-28 22:08:54 -04:00
Fix #toString() for event objects.
This commit is contained in:
parent
92e9bb2a6a
commit
14e6edb8ee
3 changed files with 8 additions and 8 deletions
|
@ -41,7 +41,7 @@ this.Base = Base.inject(/** @lends Base# */{
|
||||||
toString: function() {
|
toString: function() {
|
||||||
return '{ ' + Base.each(this, function(value, key) {
|
return '{ ' + Base.each(this, function(value, key) {
|
||||||
// Hide internal properties even if they are enumerable
|
// Hide internal properties even if they are enumerable
|
||||||
if (key.charAt(0) != '_') {
|
if (!/^_/.test(key)) {
|
||||||
var type = typeof value;
|
var type = typeof value;
|
||||||
this.push(key + ': ' + (type === 'number'
|
this.push(key + ': ' + (type === 'number'
|
||||||
? Base.formatFloat(value)
|
? Base.formatFloat(value)
|
||||||
|
|
|
@ -57,10 +57,10 @@ var KeyEvent = this.KeyEvent = Event.extend(/** @lends KeyEvent# */{
|
||||||
* @return {String} A string representation of the key event.
|
* @return {String} A string representation of the key event.
|
||||||
*/
|
*/
|
||||||
toString: function() {
|
toString: function() {
|
||||||
return '{ type: ' + this.type
|
return "{ type: '" + this.type
|
||||||
+ ', key: ' + this.key
|
+ "', key: '" + this.key
|
||||||
+ ', character: ' + this.character
|
+ "', character: '" + this.character
|
||||||
+ ', modifiers: ' + this.getModifiers()
|
+ "', modifiers: " + this.getModifiers()
|
||||||
+ ' }';
|
+ " }";
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -67,8 +67,8 @@ var MouseEvent = this.MouseEvent = Event.extend(/** @lends MouseEvent# */{
|
||||||
* @return {String} A string representation of the mouse event.
|
* @return {String} A string representation of the mouse event.
|
||||||
*/
|
*/
|
||||||
toString: function() {
|
toString: function() {
|
||||||
return '{ type: ' + this.type
|
return "{ type: '" + this.type
|
||||||
+ ', point: ' + this.point
|
+ "', point: " + this.point
|
||||||
+ ', target: ' + this.target
|
+ ', target: ' + this.target
|
||||||
+ (this.delta ? ', delta: ' + this.delta : '')
|
+ (this.delta ? ', delta: ' + this.delta : '')
|
||||||
+ ', modifiers: ' + this.getModifiers()
|
+ ', modifiers: ' + this.getModifiers()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue