mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-20 22:39:50 -05:00
Define DomEvent.stop() as a shortcut to stopPropagation() / preventDefault().
This commit is contained in:
parent
909bb6310f
commit
f6fdbd349d
2 changed files with 7 additions and 3 deletions
|
@ -79,7 +79,12 @@ var DomEvent = {
|
||||||
} else {
|
} else {
|
||||||
event.cancelBubble = true;
|
event.cancelBubble = true;
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
|
||||||
|
stop: function(event) {
|
||||||
|
DomEvent.stopPropagation(event);
|
||||||
|
DomEvent.preventDefault(event);
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
DomEvent.requestAnimationFrame = new function() {
|
DomEvent.requestAnimationFrame = new function() {
|
||||||
|
|
|
@ -29,8 +29,7 @@ var Event = this.Event = Base.extend({
|
||||||
},
|
},
|
||||||
|
|
||||||
stop: function() {
|
stop: function() {
|
||||||
this.stopPropagation();
|
DomEvent.stop(this.event);
|
||||||
this.preventDefault();
|
|
||||||
},
|
},
|
||||||
|
|
||||||
// DOCS: Document Event#modifiers
|
// DOCS: Document Event#modifiers
|
||||||
|
|
Loading…
Reference in a new issue