Closed eformx closed 5 years ago
Thanks for your contribution and finding this!
You've actually found 2 bugs, I need to look into this a bit more. _isLast()
should return true if current step is the last step in the tour, however the code in that function is wrong and returns the reverse result!
So there's something not quite right here. Leave this one with me :-)
To get mine working i added a couple of click functions inside the onNext, onPrev and onShown and seems to work quite well now if you need a workaround for the time being.
onNext: function (tour) {
$("#modalID .modal-footer input[type='submit']").click();
},
onPrev: function (tour) {
$('#modalID').modal('hide');
},
onShown: function (tour) {
$('#modalID .modal-footer button[data-dismiss="modal"]').click(function () {
tour.goTo(3);
return false;
});
},
onHidden: function (tour) {
$('#modalUserPortfolio').modal('hide');
},
It seems to go to the next step quite well when you cancel or submit in your modal, although has a small delay. When someone hits the submit button on my modal i have the page refresh and it will skip the modal step and load up the next step.
I think I've fixed this isLast problem, but I've done it in the unstable/new-backdrop branch for now. It needed a few changes but we're almost ready to move the unstable branch to the master branch so I'll wait until then to push an update to master, and then close this afterwards.
Thanks for your updates and contributions guys!
v0.3.0 uploaded into master branch, this issue should be fixed.
Great mods to orig plugin; but couldn't get it to jump to the next step when a modal was hidden. Noticed that the onModalHidden logic was not correct and flipped the methods around. If it was the last step then hide (not goto the next), and if there is a next step goto next (not end). This fixes the plugin.