You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm not sure if this is a bug or I'm wrong about the intended functionality of the onComplete function.
But when bootstro.next is called, the activeIndex is always 2 less than the count. activeIndex being incremented from 0, and count being the total count. E.g. when I am on step 7 of 8 on your demo page, and click next, the activeIndex = 6 and the count is = 8.
Therefore the onComplete call in the below code is never called.
bootstro.next = function()
{
if (activeIndex + 1 == count)
{
if (typeof settings.onComplete == 'function')
settings.onComplete.call(this, {idx : activeIndex});//
}
else
{
bootstro.go_to(activeIndex + 1);
if (typeof settings.onStep == 'function')
settings.onStep.call(this, {idx : activeIndex, direction : 'next'});//
}
};
What confuses me is the "else" statement. Are you intending for the onComplete here to be accesses with a next button located on the last step of the tour? Shouldn't that be an onExit?
What we are trying to use the onComplete for is to flag in our db that the tour has been taken. In that case, the code should read like:
bootstro.next = function()
{
if (activeIndex + 2 == count)
{
//call onComplete callback function if needed
if (this.onCompleteFunc != undefined) {
this.onCompleteFunc.call(this, { idx : activeIndex });
}
}
bootstro.go_to(activeIndex + 1);
if (typeof settings.onStep == 'function')
settings.onStep.call(this, {idx : activeIndex, direction : 'next'});//
};
The text was updated successfully, but these errors were encountered:
I'm not sure if this is a bug or I'm wrong about the intended functionality of the onComplete function.
But when bootstro.next is called, the activeIndex is always 2 less than the count. activeIndex being incremented from 0, and count being the total count. E.g. when I am on step 7 of 8 on your demo page, and click next, the activeIndex = 6 and the count is = 8.
Therefore the onComplete call in the below code is never called.
bootstro.next = function()
{
if (activeIndex + 1 == count)
{
if (typeof settings.onComplete == 'function')
settings.onComplete.call(this, {idx : activeIndex});//
}
else
{
bootstro.go_to(activeIndex + 1);
if (typeof settings.onStep == 'function')
settings.onStep.call(this, {idx : activeIndex, direction : 'next'});//
}
};
What confuses me is the "else" statement. Are you intending for the onComplete here to be accesses with a next button located on the last step of the tour? Shouldn't that be an onExit?
What we are trying to use the onComplete for is to flag in our db that the tour has been taken. In that case, the code should read like:
bootstro.next = function()
{
if (activeIndex + 2 == count)
{
//call onComplete callback function if needed
if (this.onCompleteFunc != undefined) {
this.onCompleteFunc.call(this, { idx : activeIndex });
}
}
bootstro.go_to(activeIndex + 1);
if (typeof settings.onStep == 'function')
settings.onStep.call(this, {idx : activeIndex, direction : 'next'});//
};
The text was updated successfully, but these errors were encountered: