mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-03 19:45:44 -05:00
Some code clean-up.
This commit is contained in:
parent
8983953ccc
commit
f29f3c8b11
2 changed files with 3 additions and 4 deletions
|
@ -69,7 +69,7 @@ Base.inject(/** @lends Base# */{
|
|||
var orig = props._filtering || props;
|
||||
for (var key in orig) {
|
||||
if (key in this && orig.hasOwnProperty(key)
|
||||
&& (!exclude || !exclude[key])) {
|
||||
&& !(exclude && exclude[key])) {
|
||||
var value = props[key];
|
||||
// Due to the _filtered inheritance trick, undefined is used
|
||||
// to mask already consumed named arguments.
|
||||
|
|
|
@ -76,12 +76,11 @@ var Emitter = {
|
|||
var handlers = this._callbacks && this._callbacks[type];
|
||||
if (!handlers)
|
||||
return false;
|
||||
var args = [].slice.call(arguments, 1),
|
||||
that = this;
|
||||
var args = [].slice.call(arguments, 1);
|
||||
for (var i = 0, l = handlers.length; i < l; i++) {
|
||||
// When the handler function returns false, prevent the default
|
||||
// behaviour and stop propagation of the event by calling stop()
|
||||
if (handlers[i].apply(that, args) === false
|
||||
if (handlers[i].apply(this, args) === false
|
||||
&& event && event.stop) {
|
||||
event.stop();
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue