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

Inline - optional from and to parameters #37

Open
garygreen opened this issue Jun 30, 2020 · 0 comments
Open

Inline - optional from and to parameters #37

garygreen opened this issue Jun 30, 2020 · 0 comments

Comments

@garygreen
Copy link

garygreen commented Jun 30, 2020

Presently you have to duplicate where you want to load from and to for the inline feature:

<a
        data-trimmings-inline="from: main, to: main"
        href="/cake"
      >
        Cake
      </a>
... etc
... etc

This can get pretty repetitive if you serve just a partial from the server of the exact element to be replaced.

So it would be great if the from and to were both optional and infered based on the top-root element in response from the server.

For example:

<a
        data-trimmings-inline
        href="/cake"
      >
        Cake
      </a>

Response from server:

<main>.....</main>

Trimmings will assume from: main, to: main

Another example:

<a
        data-trimmings-inline="to: custom-main"
        href="/cake"
      >
        Cake
      </a>

Assuming the same response from the server <main> trimmings will essentially assume:

from: main, to: custom-main

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

No branches or pull requests

1 participant