Define DomEvent.stop() as a shortcut to stopPropagation() / preventDefault().

This commit is contained in:
Jürg Lehni 2011-06-21 00:37:03 +01:00
parent 909bb6310f
commit f6fdbd349d
2 changed files with 7 additions and 3 deletions

View file

@ -79,7 +79,12 @@ var DomEvent = {
} else {
event.cancelBubble = true;
}
}
},
stop: function(event) {
DomEvent.stopPropagation(event);
DomEvent.preventDefault(event);
},
};
DomEvent.requestAnimationFrame = new function() {

View file

@ -29,8 +29,7 @@ var Event = this.Event = Base.extend({
},
stop: function() {
this.stopPropagation();
this.preventDefault();
DomEvent.stop(this.event);
},
// DOCS: Document Event#modifiers