-
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?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
v10.24.0 | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,6 +49,9 @@ has slowed down enough. | |
|
||
// Remove hoverintent listeners | ||
hoverListener.remove(); | ||
|
||
// Remove hoverintent and fire the out handler | ||
hoverListener.remove(true); | ||
Comment on lines
+53
to
+54
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
</script> | ||
``` | ||
|
||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more. New param; if this is |
||
if (!el) return; | ||
if (reset === true) { | ||
state = 1; | ||
dispatchOut(); | ||
} | ||
el.removeEventListener('mouseover', dispatchOver, false); | ||
el.removeEventListener('mouseout', dispatchOut, false); | ||
removeFocus(); | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,10 @@ | |
"version": "2.2.1", | ||
"repository": "[email protected]:tristen/hoverintent.git", | ||
"description": "Fire mouse events when the user intends it", | ||
"engine-strict": true, | ||
"engines": { | ||
"node": "^10.0.0" | ||
}, | ||
Comment on lines
+6
to
+9
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
"main": "index.js", | ||
"scripts": { | ||
"build": "babel index.js | uglifyjs -mc > dist/hoverintent.min.js" | ||
|
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
orn auto
.