Skip to content
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

Open
wants to merge 3 commits into
base: v2
Choose a base branch
from

Conversation

UweOhse
Copy link

@UweOhse UweOhse commented Apr 18, 2024

Bliss.ready(function() { dosomething;}) worked with v1 and should work with v2, too.

Dataset support for v2.

@@ -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)) {
Copy link
Owner

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.

Copy link
Owner

@LeaVerou LeaVerou left a 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]
}
}
Copy link
Owner

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…

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants