Skip to content
This repository has been archived by the owner on Feb 17, 2021. It is now read-only.

Commit

Permalink
fix onNext for multiPage steps
Browse files Browse the repository at this point in the history
  • Loading branch information
Gordon Koo committed Feb 6, 2013
1 parent 7237f76 commit 72bc5d6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 38 deletions.
14 changes: 8 additions & 6 deletions js/hopscotch-0.0.4.js
Original file line number Diff line number Diff line change
Expand Up @@ -1297,6 +1297,7 @@
var bubble = getBubble(),
self = this,
step,
origStep,
origStepNum,
wasMultiPage,
changeStepCb;
Expand All @@ -1305,8 +1306,9 @@

doCallbacks = utils.valOrDefault(doCallbacks, true);
step = getCurrStep();
wasMultiPage = step.multipage;
origStep = step;
origStepNum = currStepNum;
wasMultiPage = step.multipage;

/**
* Callback for goToStepWithTarget
Expand All @@ -1321,11 +1323,11 @@

if (doCallbacks) {
// Step-specific callbacks
if (direction > 0 && step.onNext) {
step.onNext();
if (direction > 0 && origStep.onNext) {
origStep.onNext();
}
else if (direction < 0 && step.onPrev) {
step.onPrev();
else if (direction < 0 && origStep.onPrev) {
origStep.onPrev();
}

// Tour-wide next/prev callbacks
Expand All @@ -1352,7 +1354,7 @@
utils.invokeCallbacks('error', [currTour.id, currStepNum]);
return this.endTour(true, false);
}
this.changeStepCb(currStepNum);
changeStepCb(currStepNum);
}

return this;
Expand Down
Loading

0 comments on commit 72bc5d6

Please sign in to comment.