Adopt the data-ps-* convention across the theme - #1096
Conversation
|
This pull request seems to contain new translation strings. I have summarized them below to ease up review:
(Note: this is an automated message, but answering it will reach a real human) |
| <div class="modal-body"> | ||
| <div class="row"> | ||
| <div class="col-md-12 col-sm-12" id="{$modal_id}-message"> | ||
| <div class="col-md-12 col-sm-12" id="{$modal_id}-message" data-ps-ref="alert-modal-message"> |
There was a problem hiding this comment.
col-md-12 col-sm-12 + row can go :-)
|
Thanks @tblivet, this is the biggest pain when working with the themes. Does it also help with the targetting in general? (A client wants to move a voucher block somewhere in the cart - refresh broken. A client wants to move some things around on product page - refresh broken.) |
|
Hi @Hlavtox! I share your point of view. The objective is to put this convention in place so we can rely on meaningful data attributes and clearly identify the JS responsibility of an element, instead of relying on For now the attributes are added alongside the old classes, which stay in the markup for retro-compatibility even though the theme's JS no longer reads them. That way nothing breaks. But to make it complete we should get rid of the old selectors, and also tackle And to answer your question, moving a block should keep working as long as it carries its attribute, since the JS will find it wherever it is placed. What will stay fragile is anything core replaces as a whole rendered chunk moving a block out of that container is not something the theme can fix on its own. |
|
@tblivet Just FYI, there is an option in the core that allows theme.yml to disable core.js loading. We implemented it because of hummingbird. The vision was to drop usage of core.js and implement these things custom way in hummingbird. |
|
Thanks for the info @Hlavtox, I didn't know this had been introduced for Hummingbird! Yes, that's something we'll have to decide for a v3 / v10 i think. Dropping |
data-ps-*convention from #934 across the theme. The selector map goes from 42% to 96%data-ps-*, and the legacyjs-*hooks bound by the theme's JS drop from 65 to 0. Remaining non-data-psentries are commented in place with the reason they stay (Bootstrap classes its own JS resolves, and twodata-link-actionvalues).Theme.selectors:backgroundCircle,idProductInput,range,searchFilterControls,searchFiltersWrapper,searchFilterToggler. No class or id removed from the markup.js-*classes left in the markup are no longer read by any theme JS and are kept for retro-compatibility only removal should be planned for v3.0