Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 2a5dbbd

Browse files
committed
refactor(jqLite): don't recreate mouse event map
1 parent 6c4d601 commit 2a5dbbd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/jqLite.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ function jqNextId() { return ++jqId; }
122122

123123
var SPECIAL_CHARS_REGEXP = /([\:\-\_]+(.))/g;
124124
var MOZ_HACK_REGEXP = /^moz([A-Z])/;
125+
var MOUSE_EVENT_MAP= { mouseleave : "mouseout", mouseenter : "mouseover"};
125126
var jqLiteMinErr = minErr('jqLite');
126127

127128
/**
@@ -788,9 +789,8 @@ forEach({
788789
// Refer to jQuery's implementation of mouseenter & mouseleave
789790
// Read about mouseenter and mouseleave:
790791
// http://www.quirksmode.org/js/events_mouse.html#link8
791-
var eventmap = { mouseleave : "mouseout", mouseenter : "mouseover"};
792792

793-
onFn(element, eventmap[type], function(event) {
793+
onFn(element, MOUSE_EVENT_MAP[type], function(event) {
794794
var target = this, related = event.relatedTarget;
795795
// For mousenter/leave call the handler if related is outside the target.
796796
// NB: No relatedTarget if the mouse left/entered the browser window

0 commit comments

Comments
 (0)