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

Commit bd27109

Browse files
author
Gordon Koo
committed
make api calls chainable
1 parent 8316dba commit bd27109

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

js/hopscotch.js

+8
Original file line numberDiff line numberDiff line change
@@ -764,6 +764,7 @@
764764
if (initOptions) {
765765
this.configure(initOptions);
766766
}
767+
return this;
767768
};
768769

769770
/**
@@ -804,6 +805,7 @@
804805
bubble = getBubble();
805806
bubble.showPrevButton(opt.showPrevButton, true);
806807
bubble.showNextButton(opt.showNextButton, true);
808+
return this;
807809
};
808810

809811
this.startTour = function() {
@@ -839,6 +841,7 @@
839841
bubble.initAnimate();
840842
}
841843
this.isActive = true;
844+
return this;
842845
};
843846

844847
this.showStep = function(stepIdx) {
@@ -859,12 +862,14 @@
859862
cookieVal += ':mp';
860863
}
861864
utils.setState(opt.cookieName, cookieVal, 1);
865+
return this;
862866
};
863867

864868
this.prevStep = function() {
865869
if (currStepNum > 0) {
866870
this.showStep(--currStepNum);
867871
}
872+
return this;
868873
};
869874

870875
this.nextStep = function() {
@@ -874,6 +879,7 @@
874879
if (currStepNum < currTour.steps.length-1) {
875880
this.showStep(++currStepNum);
876881
}
882+
return this;
877883
};
878884

879885
/**
@@ -890,6 +896,7 @@
890896
utils.clearState(opt.cookieName);
891897
}
892898
this.isActive = false;
899+
return this;
893900
};
894901

895902
/**
@@ -965,6 +972,7 @@
965972
getBubble().showPrevButton(opt.showPrevButton, true);
966973
getBubble().showNextButton(opt.showNextButton, true);
967974
getBubble().showCloseButton(opt.showCloseButton, true);
975+
return this;
968976
};
969977

970978
this.init(initOptions);

0 commit comments

Comments
 (0)