When you add link elements to the DOM, a javascript error appears as soon as you click them. This is because bootstrap pareses all links initially and adds a "scrollTo" method to each one, but new elements doesn't seem to receive this method.

CommentFileSizeAuthor
#1 bootstrap-no-scroll-to-2345323-1.patch525 bytespsha

Comments

psha’s picture

StatusFileSize
new525 bytes

This patch adds a check, to make sure scrollTo() is not undefined before calling it.

psha’s picture

Status: Active » Needs review

Status: Needs review » Needs work

The last submitted patch, 1: bootstrap-no-scroll-to-2345323-1.patch, failed testing.

  • Mark Carver committed 8f0ca40 on 7.x-3.x authored by psha
    Issue #2345323 by psha: Fixed Anchor JS error: scrollTo is undefined.
    
markhalliwell’s picture

Status: Needs work » Fixed

That is because the the script that is introducing new elements should be invoking Drupal.attachBehaviors() on the new elements. Regardless, this is still a good addition.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.