remove stopEvent from util -> event

This commit is contained in:
Fabian Jakobs 2010-12-16 18:24:58 +01:00
commit 5b02b658fe
3 changed files with 5 additions and 9 deletions

View file

@ -61,6 +61,9 @@ exports.removeListener = function(elem, type, callback) {
}
};
/**
* Prevents propagation and clobbers the default action of the passed event
*/
exports.stopEvent = function(e) {
exports.stopPropagation(e);
exports.preventDefault(e);

View file

@ -33,6 +33,7 @@ For more information about SproutCore, visit http://www.sproutcore.com
define(function(require, exports, module) {
var dom = require('pilot/dom');
var util = require('pilot/util');
@ -215,7 +216,7 @@ exports.addKeyDownListener = function(element, boundFunction) {
var handled = boundFunction(ev);
// If the boundFunction returned true, then stop the event.
if (handled) {
util.stopEvent(ev);
dom.stopEvent(ev);
}
return handled;
};

View file

@ -419,14 +419,6 @@ if (typeof(document) !== 'undefined' && document.compareDocumentPosition) {
};
}
/**
* Prevents propagation and clobbers the default action of the passed event
*/
exports.stopEvent = function(ev) {
ev.preventDefault();
ev.stopPropagation();
};
/**
* Create a random password of the given length (default 16 chars)
*/