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

Commit

Permalink
make api calls chainable
Browse files Browse the repository at this point in the history
  • Loading branch information
Gordon Koo committed Aug 7, 2012
1 parent 8316dba commit bd27109
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions js/hopscotch.js
Original file line number Diff line number Diff line change
Expand Up @@ -764,6 +764,7 @@
if (initOptions) {
this.configure(initOptions);
}
return this;
};

/**
Expand Down Expand Up @@ -804,6 +805,7 @@
bubble = getBubble();
bubble.showPrevButton(opt.showPrevButton, true);
bubble.showNextButton(opt.showNextButton, true);
return this;
};

this.startTour = function() {
Expand Down Expand Up @@ -839,6 +841,7 @@
bubble.initAnimate();
}
this.isActive = true;
return this;
};

this.showStep = function(stepIdx) {
Expand All @@ -859,12 +862,14 @@
cookieVal += ':mp';
}
utils.setState(opt.cookieName, cookieVal, 1);
return this;
};

this.prevStep = function() {
if (currStepNum > 0) {
this.showStep(--currStepNum);
}
return this;
};

this.nextStep = function() {
Expand All @@ -874,6 +879,7 @@
if (currStepNum < currTour.steps.length-1) {
this.showStep(++currStepNum);
}
return this;
};

/**
Expand All @@ -890,6 +896,7 @@
utils.clearState(opt.cookieName);
}
this.isActive = false;
return this;
};

/**
Expand Down Expand Up @@ -965,6 +972,7 @@
getBubble().showPrevButton(opt.showPrevButton, true);
getBubble().showNextButton(opt.showNextButton, true);
getBubble().showCloseButton(opt.showCloseButton, true);
return this;
};

this.init(initOptions);
Expand Down

0 comments on commit bd27109

Please sign in to comment.