Comments (10)
oops descendant
from intercooler-js.
You mean like this? Works fine.
<button id='ping' ic-post-to='/ping' ic-target='#result > .second'>Ping</button>
<ul id='result'>
<li>test1</li>
<li class='second'>test2</li>
<li>test3</li>
</ul>
from intercooler-js.
I have the same problem. In my opinion intercooler relies too heavily on defining unique global ids for DOM elements. This may work for small examples but not for complex cases where you may have lots of the same ajax components on the same page.
In my option all selectors used in Intercooler attributes should per default not be global but restricted to the children of the current element. And only if you really want to have a global selector you could put the keyword "global" in front of the selector.
Another thing which really frustrates me is that not all selectors are handled equally e.g. I can use "closest" on ic-target but not on ic-indicator.
from intercooler-js.
In doc you can read "attribute should be a valid global CSS/JQuery selector OR the string closest followed by a space, followed by a valid CSS selector, which will be evaluated as the closest parent matching the given selector".
And, as @whoever123 said, any "valid global CSS/JQuery selector" works fine.
from intercooler-js.
Yes but that is not my point. My point is that I want not a global selector ($(selector)
) but a lokal one ($(selector, el)
).
from intercooler-js.
Can you use "closest" reserved word (eg "closest div.modal-content")?
Or remember that the attribute may be placed on parent elements.
from intercooler-js.
Why not post a codepen sample?
from intercooler-js.
This is my case http://codepen.io/anon/pen/avRrbe
Its just the markup. My problem is that this is a component which is in use multiple times on the page and I don't want to create artifical unique id attributes for .voting
or .voting__progress
just to be able to select them.
from intercooler-js.
@webholics, i don't understand well what is your problem, but if you have multiple ".voting" blocks, everyone with its progress, take a look at http://codepen.io/anon/pen/rOqgeb (css is only for sample).
I hope this can help you
from intercooler-js.
Hi webholics. I can see your point, generating unique IDs in repeated UX is ugly and annoying. It seems like a sane algorithm would be to try the selector first as a find() from the current element, then as a global selector.
I will try to get something along those lines in the next release.
from intercooler-js.
Related Issues (20)
- simple Django - Intercooler.js example on how to pass a django variable to a view HOT 2
- It appears the google group is gone HOT 4
- Default values not displayed on refresh HOT 5
- IC potential clash with jquery ? HOT 2
- Set history and new URL after ic-get-from? HOT 3
- Suggest clarification on `ic-target` HOT 1
- How get and populate different targets with a single POST request HOT 3
- Can ic-get-from include value of triggered input? HOT 2
- Prepend element before a target and remove element afterwards HOT 5
- Query string keeps getting bigger ic-get-from / ic-current-url HOT 1
- Preventing default for a button inside a form HOT 4
- ic-push-params: multiple GET parameters with same name cannot be pushed to URL HOT 1
- Intercooler.ready is executed on document.ready HOT 9
- Elements with SSE trigger do not get cleaned up when swapped out of the DOM HOT 6
- ic-action does not support chained derefences HOT 5
- New add-object form includes a dependent select HOT 2
- document bootstrap version on example(s)
- intercooler-1.1.1.min.js offline HOT 3
- ic-trigger-from not working on form with ic-post-to HOT 1
- Extending the functionality of Intercooler to other controls
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from intercooler-js.