sul-dlss/SearchWorks — pull request #913 by mejackreed (2014-09-17 20:53:42+00:00)
Title: change selector instantiation to be less greedy

The problem was on a results page this plugin was instantiated `n` times. This was causing `(n(n+1))/2` number of queries to Google on a results page.

A little whitespace thrashing... but the real change is 1 line LN160. Change the selector so that it is only instantiating on record view pages.

I have checked the following:
- [ ] gallery view
- [ ] normal view
- [ ] brief view
- [ ] previews
- [ ] browse nearby (js plugin and page)

All seem to have book covers rendering properly with this change.