From 01b10d7a24b371e667dfd5b081e98a690b0fc426 Mon Sep 17 00:00:00 2001 From: Igor Minar Date: Mon, 4 Aug 2014 20:14:15 -0700 Subject: [PATCH] refactor(jqLite): remove code duplication --- src/jqLite.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/jqLite.js b/src/jqLite.js index 63551875..00fe1cc4 100644 --- a/src/jqLite.js +++ b/src/jqLite.js @@ -783,9 +783,9 @@ forEach({ var eventFns = events[type]; if (!eventFns) { - if (type == 'mouseenter' || type == 'mouseleave') { - events[type] = []; + events[type] = []; + if (type == 'mouseenter' || type == 'mouseleave') { // Refer to jQuery's implementation of mouseenter & mouseleave // Read about mouseenter and mouseleave: // http://www.quirksmode.org/js/events_mouse.html#link8 @@ -801,7 +801,6 @@ forEach({ } else { addEventListenerFn(element, type, handle); - events[type] = []; } eventFns = events[type]; }