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

A node should be able to have more than 1 refresh key #36

Open
qq99 opened this issue Nov 13, 2014 · 7 comments
Open

A node should be able to have more than 1 refresh key #36

qq99 opened this issue Nov 13, 2014 · 7 comments

Comments

@qq99
Copy link
Contributor

qq99 commented Nov 13, 2014

I propose that there's a good argument for having nodes with more than 1 key per refresh attribute.

Simulation:

<div id="modal" refresh="foo"></div>
<div id="container" refresh="foo">
  <div id="ohno">I contain client side state and must not be refreshed!</div>
  <div id="bar" refresh="bar">
    ...
  </div>
</div>

Say I want to refresh the innards of div#bar without refreshing div#container, because perhaps the controls that I'm using to refresh div#bar exist inside the div#ohno.

However, I also want to refresh the div#modal element, but I can't, because due to previous constraints, it's already got the key foo and refreshes along with div#container div. Now, I can't refresh just refresh=bar and div#modal without refreshing div#container

Allowing you to supply a list of refresh keys would be nice, so I could have my modal look like this:

<div id="modal" refresh="foo bar"></div>

and semantically this means that div#modal gets refreshed whenever foo-like or bar-like content changes.

I'm pretty sure this is not how things behave now

cc @patrickdonovan @nsimmons @pushrax @celsodantas

@pushrax
Copy link
Contributor

pushrax commented Nov 13, 2014

I don't mind this, but it would be kinda difficult to do while still using querySelectorAll

for node in document.querySelectorAll("[refresh=#{key}]")

@celsodantas
Copy link
Contributor

👍 for this.

We could use this http://api.jquery.com/attribute-contains-selector/
$("[refresh*='#{key}']")

@celsodantas
Copy link
Contributor

humm, maybe not. Would not work for compound words.

@celsodantas
Copy link
Contributor

$("[refresh~='#{key}']") seems to work.

@qq99
Copy link
Contributor Author

qq99 commented Nov 13, 2014

yeah it's looking more & more like we may need to use jQ
not sure if there's a nice DOM native way

@nsimmons
Copy link
Contributor

In that case why couldn't we use a separate refresh key

?

Maybe I am missing something, but this does not seem necessary.

On Thu, Nov 13, 2014 at 11:22 AM, Anthony Cameron notifications@github.com
wrote:

yeah it's looking more & more like we may need to use jQ
not sure if there's a nice DOM native way


Reply to this email directly or view it on GitHub
#36 (comment).

@qq99
Copy link
Contributor Author

qq99 commented Nov 13, 2014

Well, previous constraints on the page make it so I cannot change the refresh key on the container (cause then the container does not update when another operation's refresh fires)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants