Attach event handlers based on HTML data attributes#608
Open
rsek wants to merge 8 commits into
Open
Conversation
rsek
marked this pull request as ready for review
January 25, 2023 02:06
Collaborator
Author
|
i reckon that i can build on this, but it's quite mergeable as-is, so let's do that. i don't need more long-running PRs, haha |
ben
approved these changes
Jan 25, 2023
ben
left a comment
Owner
There was a problem hiding this comment.
I like it. If you've manually tested every one of these changes, go ahead and merge it!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Draft to explore a more structured approach to applying event listeners. It prefers data attributes like
data-on-click="methodName"so that programmatically relevant data has its own bucket, rather than living with styling information. Practically speaking, that should make it safer to e.g. monkey with CSS classes without accidentally breaking a button.verbNoun, and make the methods correspond to thesedevelop a function (or a class mixin?) to standardize adding "onto be addressed in its own PRevent, domethod()" listeners