• Caden Lovelace's avatar
    Handle multiple zero-offset Scrollspy elements. · a1aa0f8a
    Caden Lovelace authored
    When the first two elements in a scrollspy content block have a document
    offset of zero (i.e. they're hard against the top of the page),
    Scrollspy would switch between them on every scroll event.
    
    This could happen, for example, in a system of nested sections:
    
    ```
    <section id="animals">
      <section id="dogs">
    	Content
      </section>
    </section>
    ```
    
    This ocurred because Scrollspy's check to see if it's at the end of the
    array of sections uses `!arr[index]`. This misses the case where
    `arr[index]` does exist and is zero.
    
    This commit explicitly checks the array bounds.
    a1aa0f8a
Name
Last commit
Last update
dist Loading commit data...
docs Loading commit data...
fonts Loading commit data...
grunt Loading commit data...
js Loading commit data...
less Loading commit data...
test-infra Loading commit data...
.editorconfig Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
.travis.yml Loading commit data...
CNAME Loading commit data...
CONTRIBUTING.md Loading commit data...
Gruntfile.js Loading commit data...
LICENSE Loading commit data...
README.md Loading commit data...
_config.yml Loading commit data...
bower.json Loading commit data...
composer.json Loading commit data...
package.js Loading commit data...
package.json Loading commit data...