-
Notifications
You must be signed in to change notification settings - Fork 275
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 data-lift-fixedeventattribute-<event-name> for each replaced event-attribute #1701
Conversation
…t-attribute, with settings in LiftRules: LiftRules.includeFixedEventAttributesAsDataAttributes_? (default false)
Two broad thoughts on the feature:
Thought on both fronts is that having one attribute to represent these would be nice. Using a class is nice because there's such strong and optimized support for selection on classes in browsers. |
I somewhat think that "removed" is a little bit too general in this case so I propose using Ok? |
A colleague of mine pointed out that the name should be |
* } | ||
* </pre> | ||
*/ | ||
@volatile var includeFixedEventAttributesAsDataAttributes_? = false |
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.
Two questions:
- Should this be
includeRemovedEventAttributesAsDataAttributes_?
? - Let's use Scaladoc markup rather than HTML (triple-backticks for multiline code blocks, single backticks for inline code blocks, empty lines for line breaks, etc).
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.
- Yes, Fixed in last commit.
- I'm not able to make this change in a way that IntelliJ will recognize the markup and show the same as the HTML-version. Can you make the changes you suggest?
…dded configurable attribute-name for "data-lift-removed-attributes", set in LiftRules.removedEventAttributesAttributeName
I added a configurable setting, LiftRules.removedEventAttributesAttributeName = "data-lift-removed-attributes", so that one can change that if wanted. |
I'm going to merge the two |
We now have one LiftRules.attributeForRemovedEventAttributes, which can be None to indicate no attribute should be emitted. The default is currently None.
That's of course much better, thanks! |
Schweet, give that a shot and see what you think! |
Just tested it and it works great! |
👍 I'll leave it here for another day or two in case anyone else wants to make some remarks and then . |
All righty let's do it! |
Add LiftRules.attributeForRemovedEventAttributes This PR adds a LiftRule, LiftRules.attributeForRemovedEventAttributes. When we remove a JavaScript event from an element for separate application via the page's JS file, if this rule is set, the attribute it specified is populated with the names of the attributes that were removed from the element. If no attributes were removed, no attribute is added to the element. The default for the LiftRule is to be None, meaning this information is never added to the output.
👍 |
Add data-lift-fixedeventattribute- for each replaced event-attribute, with settings in LiftRules: LiftRules.includeFixedEventAttributesAsDataAttributes_? (default false)