Skip to content

Commit

Permalink
Merge pull request #146 from alejandroiglesias/patch-1
Browse files Browse the repository at this point in the history
Add parameter to postStepCallback and postRideCallback to know if tour has been aborted
  • Loading branch information
Jordan Humphreys committed Dec 23, 2013
2 parents 940a602 + 9065a85 commit 9685a1e
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions jquery.joyride-2.1.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@

settings.$document.on('click.joyride', '.joyride-close-tip', function (e) {
e.preventDefault();
methods.end();
methods.end(true /* isAborted */);
});

settings.$window.bind('resize.joyride', function (e) {
Expand Down Expand Up @@ -823,7 +823,8 @@
}
},

end : function () {
end : function (isAborted) {
isAborted = isAborted || false;
if (settings.cookieMonster) {
$.cookie(settings.cookieName, 'ridden', { expires: 365, domain: settings.cookieDomain, path: settings.cookiePath });
}
Expand All @@ -842,8 +843,8 @@
settings.$current_tip.hide();
}
if (settings.$li) {
settings.postStepCallback(settings.$li.index(), settings.$current_tip);
settings.postRideCallback(settings.$li.index(), settings.$current_tip);
settings.postStepCallback(settings.$li.index(), settings.$current_tip, isAborted);
settings.postRideCallback(settings.$li.index(), settings.$current_tip, isAborted);
}
$('.joyride-modal-bg').hide();
},
Expand Down Expand Up @@ -885,7 +886,7 @@
// Escape key.
event.keyCode === 27 ) {
event.preventDefault();
methods.end();
methods.end(true /* isAborted */);
return;
}

Expand Down

0 comments on commit 9685a1e

Please sign in to comment.