Do not create translations object every time method is called.

This commit is contained in:
Juriy Zaytsev 2009-11-12 21:21:42 -05:00
parent c272e40042
commit 829800834d

View File

@ -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);
};
}