I am using the Expander plugin on a
Simile Exhibit application, and it works fine except that the way I have to use it in Exhibit, the application makes multiple calls to the Expander function. This results in multiple collapse links appearing at the end of the text I set as expandable. I was able to resolve this by applying this patch. It simply checks before adding the collapse link and does not add it if it is already there.
I am including this here in case anyone else runs into this problem.
- 101,103c101,105
- < $this
- < .find('span.details').append('<span class="re-collapse">' + o.userCollapsePrefix + '<a href="#">' + o.userCollapseText + '</a></span>');
- < $this.find('span.re-collapse a').click(function() {
- ---
- > // Don't add collapse link if it's already there
- > var target = $this.find('span.details');
- > if (target.html().indexOf('re-collapse') == -1) {
- > target.append('<span class="re-collapse">' + o.userCollapsePrefix + '<a href="#">' + o.userCollapseText + '</a></span>');
- > $this.find('span.re-collapse a').click(function() {
- 105,110c107,113
- < clearTimeout(delayedCollapse);
- < var $detailsCollapsed = $(this).parents('span.details');
- < reCollapse($detailsCollapsed);
- < o.onCollapse($this, true);
- < return false;
- < });
- ---
- > clearTimeout(delayedCollapse);
- > var $detailsCollapsed = $(this).parents('span.details');
- > reCollapse($detailsCollapsed);
- > o.onCollapse($this, true);
- > return false;
- > });
- > }
- 112c115
- < });
- ---
- > });