Hello,
We are using the apachesolr and apachesolr_views module to run our catalog. I recently installed Views Infinite Scroll, which uses ajax to reload content. This, in turn, fires the apachesolr.js Behaviors function that appends the "Show more" links to the facet blocks (with the classes of block-apachesolr_search and block-apachesolr). The result is multiple instances of "Show more" appended to the facet blocks.
The attached patch adds a class "apachesolr-processed" to the blocks after this show/hide link is initially appended to the block, and then sets a :not condition in the JS function which provides the link. This way, the link is only appended once, and future ajax calls do not result in a duplicate link.
Note that in Drupal 7 this function should probably use .once() in parallel with the .append function. I'd be happy to provide a patch for that once I'm able to test. (We're currently still in D6 for the next few months, at least.)
Thanks!
| Comment | File | Size | Author |
|---|---|---|---|
| apachesolr_js_processed.patch | 724 bytes | torgospizza |
Comments
Comment #2
nick_vhClosing in favor of 6.x-3.x and because nobody seems to care (time of last response) or cannot reproduce. If you think this is still an issue in 6.x-3.x, feel free to re-open!
In this case, I do think that people will be interested in your solution. So thanks for providing that!