mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-03 19:45:44 -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 {
|
||||
event.cancelBubble = true;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
stop: function(event) {
|
||||
DomEvent.stopPropagation(event);
|
||||
DomEvent.preventDefault(event);
|
||||
},
|
||||
};
|
||||
|
||||
DomEvent.requestAnimationFrame = new function() {
|
||||
|
|
|
@ -29,8 +29,7 @@ var Event = this.Event = Base.extend({
|
|||
},
|
||||
|
||||
stop: function() {
|
||||
this.stopPropagation();
|
||||
this.preventDefault();
|
||||
DomEvent.stop(this.event);
|
||||
},
|
||||
|
||||
// DOCS: Document Event#modifiers
|
||||
|
|
Loading…
Reference in a new issue