From 5b02b658fedb954841592de127038198c3f2f163 Mon Sep 17 00:00:00 2001 From: Fabian Jakobs Date: Thu, 16 Dec 2010 18:24:58 +0100 Subject: [PATCH] remove stopEvent from util -> event --- plugins/pilot/event.js | 3 +++ plugins/pilot/keyboard/keyutil.js | 3 ++- plugins/pilot/util.js | 8 -------- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/plugins/pilot/event.js b/plugins/pilot/event.js index 2beaff41..fdea7164 100644 --- a/plugins/pilot/event.js +++ b/plugins/pilot/event.js @@ -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); diff --git a/plugins/pilot/keyboard/keyutil.js b/plugins/pilot/keyboard/keyutil.js index bbc0ac5a..497f316e 100644 --- a/plugins/pilot/keyboard/keyutil.js +++ b/plugins/pilot/keyboard/keyutil.js @@ -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; }; diff --git a/plugins/pilot/util.js b/plugins/pilot/util.js index bb1550e3..0ae29c9e 100644 --- a/plugins/pilot/util.js +++ b/plugins/pilot/util.js @@ -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) */