Skip to content

Commit eaaa2dd

Browse files
committed
Merge pull request usablica#225 from andragan/master
added onafterchange handler, and call it just before the end of _showElem...
2 parents 1d2491d + 5d90d0c commit eaaa2dd

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

intro.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -654,6 +654,10 @@
654654
window.scrollBy(0, bottom + 100); // 70px + 30px padding from edge to look nice
655655
}
656656
}
657+
658+
if (typeof (this._introAfterChangeCallback) !== 'undefined') {
659+
this._introAfterChangeCallback.call(this, targetElement.element);
660+
}
657661
}
658662

659663
/**
@@ -886,6 +890,14 @@
886890
}
887891
return this;
888892
},
893+
onafterchange: function(providedCallback) {
894+
if (typeof (providedCallback) === 'function') {
895+
this._introAfterChangeCallback = providedCallback;
896+
} else {
897+
throw new Error('Provided callback for onafterchange was not a function');
898+
}
899+
return this;
900+
},
889901
oncomplete: function(providedCallback) {
890902
if (typeof (providedCallback) === 'function') {
891903
this._introCompleteCallback = providedCallback;

0 commit comments

Comments
 (0)