sorich87 / bootstrap-tour

Quick and easy product tours with Twitter Bootstrap Popovers
http://bootstraptour.com
MIT License
4.44k stars 942 forks source link

Blink effect on redirect #682

Open camohub opened 6 years ago

camohub commented 6 years ago

I needs to generate steps dynamically because of step.path param. So I do it in for cycle like in the code below. But if tour redirects to another page, the new popup blinks like it is loaded twice. Is there a way to fix it. May be it is caused by the steps content which is different after the redirect.

for( var i = 0; i < steps.length; i++ )
{
    var step = {};
    step.title = steps[i].title;
    step.title = steps[i].content;
    if( steps[i].orphan ) step.orphan = true;
    if( steps[i].element ) step.element = steps[i].element;
    if( steps[i].placement ) step.placement = steps[i].placement;

    var regexp = new RegExp( steps[i].url, 'gi');
    if( ! document.location.href.match( regexp ) )
    {
        step.path = steps[i].url;
    }
    step.onShow = function() {
        console.log( 'onShow' );
        alert('onShow');
    };
    step.onShown = function() {
        console.log( 'onShown' );
        alert('onShown');
    };

    tour.addStep( step );
}

EDIT: This is related to issue with scroll https://github.com/sorich87/bootstrap-tour/issues/681 So I am in the cycle.