-
Notifications
You must be signed in to change notification settings - Fork 43
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
Global pat-inject #703
Comments
Note: the current pat-inject documentation mentions that a property 'selector' already exists, but I think that that's a typo and that that should be 'source'. |
I like the global injection idea. |
Will be made obsolete by https://github.com/quaive/ploneintranet.prototype/issues/1064 |
Context
In the beginning when the web was void and empty we used a pat-inject statement here and there to smoothen things up. Today I fill my days writing
class="pat-inject" data-pat-inject="history: record"
on every possible link. History: record is something that we want almost every time.Problem
We could make it a default and have history: no-record for the exceptions. But the pat-inject class is still needed on every link and form which is a lot of work. Also we have no control over links in rich texts written by editors. And those should use inject too for smooth operation of applications such as Quaive.
Proposal
I propose to introduce a 'selector' property for pat-inject. The selector property allow for pointing to the element(s) on which the inject statement should take effect. The default value is 'self' like it is now. The selector would within the context of the container element the statement is placed on.
Example:
The above example would apply basic injection behaviour for everthing that loads content on the site.
It should be possible to overrule the inject statement. For instance when an injection is sometimes not desired or when another combination of source and target is desired.
To a designer it would feel natural to overrule property by property. But I think that would be too complex. I would propose to overrule pat-inject on a link or form element altogether simply by putting a class pat-inject on the element. It will accept only its own properties.
When no injection is required on an element that matches the pat-inject selector of its container, I propose the following:
class="pat-inject" data-pat-inject="none"
.The text was updated successfully, but these errors were encountered: