From 829800834def0ac16a09c22df95f371c84ba9cfd Mon Sep 17 00:00:00 2001 From: Juriy Zaytsev Date: Thu, 12 Nov 2009 21:21:42 -0500 Subject: [PATCH] Do not create translations object every time method is called. --- src/dom/event.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/dom/event.js b/src/dom/event.js index 0d86e11..b57d3c4 100644 --- a/src/dom/event.js +++ b/src/dom/event.js @@ -379,12 +379,12 @@ window.addEventListener('unload', Prototype.emptyFunction, false); - var _getDOMEventName = Prototype.K; + var _getDOMEventName = Prototype.K, + translations = { mouseenter: "mouseover", mouseleave: "mouseout" }; if (!MOUSEENTER_MOUSELEAVE_EVENTS_SUPPORTED) { _getDOMEventName = function(eventName) { - var translations = { mouseenter: "mouseover", mouseleave: "mouseout" }; - return eventName in translations ? translations[eventName] : eventName; + return (translations[eventName] || eventName); }; }