From f0168bb9fd6802127032eaf299236e755c618ede Mon Sep 17 00:00:00 2001 From: Nicolas Coden Date: Wed, 25 Jul 2018 23:59:34 +0200 Subject: [PATCH] style: fix incorrectly named variable in ignoreMousedisappear utility --- js/foundation.core.utils.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/js/foundation.core.utils.js b/js/foundation.core.utils.js index 36e5cbde4..65e32126d 100644 --- a/js/foundation.core.utils.js +++ b/js/foundation.core.utils.js @@ -109,8 +109,8 @@ function onLoad($elem, handler) { * @returns {Function} - filtered handler to use to listen on the `mouseleave` event. */ function ignoreMousedisappear(handler, { ignoreLeaveWindow = false, ignoreReappear = false } = {}) { - return function leaveEventHandler(eEnter, ...rest) { - const callback = handler.bind(this, eEnter, ...rest); + return function leaveEventHandler(eLeave, ...rest) { + const callback = handler.bind(this, eLeave, ...rest); // In firefox if the user switched between windows, the window sill have the focus by the time // the event is triggered. We have to debounce the event to test this case. @@ -118,7 +118,7 @@ function ignoreMousedisappear(handler, { ignoreLeaveWindow = false, ignoreReappe // The mouse left: call the given callback... // - if the mouse entered elsewhere (`relatedTarget` is where) - if (eEnter.relatedTarget !== null + if (eLeave.relatedTarget !== null // - if the user switched to an other window (and we don't ignore it) || !ignoreLeaveWindow && document.hasFocus && !document.hasFocus()) { callback(); @@ -128,10 +128,10 @@ function ignoreMousedisappear(handler, { ignoreLeaveWindow = false, ignoreReappe else if (!ignoreReappear) { $(document).one('mouseenter', function reenterEventHandler(eReenter) { // - if the mouse reentered outside of the element it left. - if (!$(eEnter.currentTarget).has(eReenter.target).length) { + if (!$(eLeave.currentTarget).has(eReenter.target).length) { // Fill where the mouse finally entered. - eEnter.relatedTarget = eReenter.target; + eLeave.relatedTarget = eReenter.target; callback(); } -- 2.47.2