mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-05 20:32:00 -05:00
Have Events print modifiers correctly in #toString().
This commit is contained in:
parent
5a9dc3dece
commit
04ff593adc
3 changed files with 6 additions and 4 deletions
|
@ -212,7 +212,7 @@ var ToolEvent = this.ToolEvent = Base.extend({
|
|||
return '{ type: ' + this.type
|
||||
+ ', point: ' + this.point
|
||||
+ ', count: ' + this.count
|
||||
+ ', modifiers: ' + this.modifiers
|
||||
+ ', modifiers: ' + this.getModifiers(true)
|
||||
+ ' }';
|
||||
}
|
||||
});
|
||||
|
|
|
@ -35,7 +35,9 @@ var Event = this.Event = Base.extend({
|
|||
this.preventDefault();
|
||||
},
|
||||
|
||||
getModifiers: function() {
|
||||
return Key.modifiers;
|
||||
getModifiers: function(asString) {
|
||||
return asString ? '{ ' + Base.each(Key.modifiers, function(value, key) {
|
||||
this.push(key + ': ' + value);
|
||||
}, []).join(', ') + ' }' : Key.modifiers;
|
||||
}
|
||||
});
|
||||
|
|
|
@ -27,7 +27,7 @@ var KeyEvent = this.KeyEvent = Event.extend(new function() {
|
|||
return '{ type: ' + this.type
|
||||
+ ', key: ' + this.key
|
||||
+ ', character: ' + this.character
|
||||
+ ', modifiers: ' + this.modifiers
|
||||
+ ', modifiers: ' + this.getModifiers(true)
|
||||
+ ' }';
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue