Problem: When a block is active in a context, the HTML for that item is hidden through the jQuery .hide() option. This prevents the ability to both display this hidden item and render it differently from addable-blocks that are not active in a context.
Use case: I would like to always show all possible blocks for a category regardless if that block is currently active in the context being edited. Active blocks will appear differently within the block browser to convey to the viewer that those blocks are currently in use.
Solution: The patch provided removes .hide() and uses 'context-block-addable' and 'context-block-added' to differentiate between active and inactive blocks. It introduces a 'context-block-item' class so all blocks can share a common style when desired. The draggable state is disabled and enabled as needed. Appropriate CSS styles have been updated, and the hidden effect of 'added' blocks has been retained. Note that the ginko theme will likely need to be updated (e.g.: palette).
Using this patch has allowed me to implement the use case I outlined above.
Comment | File | Size | Author |
---|---|---|---|
#5 | context.ui_sortable_cancel-754436-5.patch | 1.63 KB | Grayside |
#4 | 754436_context_ui_sortable_cancel.patch | 1.62 KB | hefox |
context_ui_expand.patch | 3.9 KB | ceardach | |
Comments
Comment #1
yhahn CreditAttribution: yhahn commentedGreat, committed: http://drupal.org/cvs?commit=359520
Comment #3
hefox CreditAttribution: hefox commentedThis is currently not working quite well, as I believe context is no longer using draggable? but sortable? So the item is never un-draggable/sortable, so draggable(disable) and draggable(enable) really aren't doing anything. Well, some change broke it.
Comment #4
hefox CreditAttribution: hefox commentedThis appears to work, use sortable cancel arg to say what items aren't sortable.
Comment #5
Grayside CreditAttribution: Grayside commentedAttached is a straight reroll for easier patching.
Comment #9
DeaOm CreditAttribution: DeaOm at Agiledrop - Your Trusted Drupal Teammates commented