-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add reset option to support dispatching onOut event when removing #33
base: gh-pages
Are you sure you want to change the base?
Conversation
@@ -0,0 +1 @@ | |||
v10.24.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Allows switching to the correct node version with something like nvm use
or n auto
.
// Remove hoverintent and fire the out handler | ||
hoverListener.remove(true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wasn't sure this was the right place for it, but wanted to show a real world usage. If this is intended as a snippet that can be copy/pasted, might be worth moving this to a different location.
@@ -107,8 +107,12 @@ module.exports = function(el, onOver, onOut) { | |||
el.removeEventListener('blur', dispatchBlur, false); | |||
} | |||
|
|||
h.remove = function() { | |||
h.remove = function(reset) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New param; if this is true
the mouse out event will fire before removing the event listeners.
"engine-strict": true, | ||
"engines": { | ||
"node": "^10.0.0" | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will require the correct node version so that the build script runs properly.
Solves #21 -- alternate solve to what #32 is doing.
--
This PR adds the option to
reset
the hoverintent usage whenremove
takes places. This optionally fires theonOut
event to do any sort of cleanup required. The option is passed as a parameter to theremove
event to keep things colocated where possible.Also added an
.nvmrc
file with the recommended node version and the properengine
entries to thepackage.json
files as the build function only ran in node version < 11.