Drupal.behaviors handles auto attaching 'on document ready' and when new elements are dynamically added to the page.
hide_this_block.js really only needs to register a function with Drupal.behaviors.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | hide_this_block-900058-Drupal.behaviors.patch | 1.47 KB | recrit |
Comments
Comment #1
recrit commentedattached patch alters the js code to register the click event with Drupal.behaviors.
Comment #2
torgospizzaWorked like a charm for me. Attaching with a behavior also allowed me to override the default functionality, since I'm putting the block into an "announcement" container div, I needed to be able to slideUp() that parent div as well.
Thanks!
Comment #3
pbull commentedFinding time to breathe some life back into this module, which I've sadly neglected. Committed to 6.x-1.x branch.