Skip to content

Commit

Permalink
Merge pull request #25 from hyperaudio/24-jQuery-scope
Browse files Browse the repository at this point in the history
24 detects if Velocity has been placed on the jQuery object
  • Loading branch information
maboa authored Feb 11, 2021
2 parents aef920d + e8235bb commit b61cebd
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions js/hyperaudio-lite.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ var hyperaudiolite = (function () {
currentTime,
windowHash,
hashArray,
hashVar;
hashVar,
velocity;


function init(mediaElementId, m) {
Expand Down Expand Up @@ -160,6 +161,8 @@ var hyperaudiolite = (function () {
}
}
}

velocity = Velocity || jQuery.Velocity || window.jQuery.Velocity;
}

function getSelectionMediaFragment() {
Expand Down Expand Up @@ -346,11 +349,14 @@ var hyperaudiolite = (function () {
}

if (currentParaIndex != paraIndex) {
Velocity(scrollNode, "scroll", {
container: transcript,
duration: 800,
delay: 0
});

if (typeof velocity !== 'undefined') {
velocity(scrollNode, "scroll", {
container: transcript,
duration: 800,
delay: 0
});
}

newPara = true;

Expand Down

0 comments on commit b61cebd

Please sign in to comment.