-
Notifications
You must be signed in to change notification settings - Fork 101
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
fix incompatibility to v1. $.ready(function() {}) used to work. #259
base: v2
Are you sure you want to change the base?
Conversation
@@ -3,7 +3,7 @@ import bind from "./bind.js"; | |||
|
|||
function delegate (subject, type, selector, callback) { | |||
bind(subject, type, function(evt) { | |||
if (evt.target.closest(selector)) { | |||
if ((evt.target.closest ? evt.target : evt.target.parentNode).closest(selector)) { |
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.
What is this change for? Any Element
instance has closest
, so I’m not sure what EventTarget
instances there are that don’t have closest
but their parents do. Even if such a node exists, this should be documented with comments because it's totally non-obvious.
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.
Hi there, thanks for sending a PR! LGTM except the two things mentioned in the comments.
for (const key of Object.keys(value)) { | ||
subject.dataset[key]=value[key] | ||
} | ||
} |
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.
Nit: Please follow the code style of the rest of the codebase (smart tabs for indentation, space around operators, etc.). I need to add an ESLint file…
Bliss.ready(function() { dosomething;}) worked with v1 and should work with v2, too.
Dataset support for v2.