Permalink
Browse files

fix(scrollspy): Trigger refresh on transitionend event

  • Loading branch information...
tmorehouse committed Sep 21, 2017
1 parent 7fe954a commit 947b5e0facff2239a538a31c72546b1c388adf60
Showing with 14 additions and 0 deletions.
  1. +14 −0 lib/classes/scrollspy.js
@@ -68,6 +68,14 @@ const OffsetMethod = {
// HREFs must start with # but can be === '#', or start with '#/' or '#!' (which can be router links)
const HREF_REGEX = /^#[^/!]+/;
// Transition Events
const TransitionEndEvents = [
'webkitTransitionEnd',
'transitionend',
'otransitionend',
'oTransitionEnd'
];
/*
* Utility Methods
*/
@@ -186,6 +194,9 @@ class ScrollSpy {
eventOn(window, 'scroll', this);
eventOn(window, 'resize', this);
eventOn(window, 'orientationchange', this);
TransitionEndEvents.forEach(evtName => {
eventOn(window, evtName, this);
});
this.setObservers(true);
// Scedule a refresh
this.handleEvent('refresh');
@@ -200,6 +211,9 @@ class ScrollSpy {
eventOff(window, 'scroll', this);
eventOff(window, 'resize', this);
eventOff(window, 'orientationchange', this);
TransitionEndEvents.forEach(evtName => {
eventOffindow, evtName, this);
});
}
setObservers(on) {

0 comments on commit 947b5e0

Please sign in to comment.