Needs work
Project:
Entityreference Browser
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
4 May 2012 at 17:14 UTC
Updated:
20 Feb 2013 at 08:16 UTC
Jump to comment: Most recent file
This was a great little feature of the original module, that died with the (much needed) reduction in ajax calls. Seems like this could be pretty easily accomplished with the JS, but is that the best solution? I'm concerned about keeping pace with #1514558: widget doesn't work without javascript, which looks to reduce JS dependence.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | erb_toggle_1561484.patch | 1.42 KB | jason.fisher |
Comments
Comment #1
davidseth commentedYes, I was thinking about this as well. I think a simple JS solution is the way to go. And when a filter is applied or paging, the system does pass in currently selected IDs so they will be excluded.
And the issue you refer to #1514558 will most likely be best solved with a simple fallback to select lists or something. I need to look at what Drupal does for their autocomplete boxes when the system falls back to no JS.
If I have time I will try to tackle this sometime this week, but patches are always welcome in the meantime! :)
Comment #2
ohthehugemanatee commentedSadly I'm useless at JS... but I'm actively using this project on a site to reference users, so I will send in patches as I write them!
Comment #3
jason.fisher commented- added context to the body delegate tags, which corrected a double execution issue that showed itself after adding toggle. This should help performance after many clicks on large forms.
- added "picked" class toggle. When you click on a.picker, it becomes a.picker.picked. When you click again, it returns to a.picker and the list element is also removed.
The selected list element can then be hidden with CSS if you do not need it visually.
This patch should apply to the latest sandbox release.. I did not try applying it myself though.
Regards,
Jason Fisher
Comment #4
davidseth commentedHello @jason.fisher, thanks for the great patch. I will review and see if it works.
Comment #5
gunwald commentedI think, it would be much better to add a class to the selected entities, so you can decide with css whether to hide or to mark them as active: http://drupal.org/node/1921316
Comment #6
jason.fisher commentedAren't we doing the same thing? Just with addClass/removeClass vs toggleClass?
Comment #7
jason.fisher commented"selected" is probably a better class name than "picked" ..
Comment #8
gunwald commentedYou are right! I did not look into your code, I had written my weeks ago and did realize, that your post treats the same issue, only after having done my post.