Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delay backdrop change until popupDelay finishes #57

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

joecoolish
Copy link

In the case of animation between frames, the backdrop will instantly appear, which might bind to the elements while they are animating. By waiting until the popupDelay has finished to create the backdrop, this can be avoided.

TODO: Maybe hide the previous backdrop?

In the case of animation between frames, the backdrop will instantly appear, which might bind to the elements while they are animating.  By waiting until the popupDelay has finished to create the backdrop, this can be avoided.

TODO:  Maybe hide the previous backdrop?
@benmarch
Copy link
Owner

benmarch commented Jun 8, 2016

Thanks, @joecoolish, I will test this out locally.

@benmarch
Copy link
Owner

Hey @joecoolish, I tested this out locally and it doesn't exactly work as expected. Since the backdrop promise doesn't resolve until after the backdrop delay, the popup also delays after the backdrop shows. For example, if the popup delay is set to 1 second, the backdrop will show up after 1 second, and then the popup will show up 1 second after that. The following modification addresses that:

return handleEvent(step.config('onShow')).then(function () {

    if (!step.config('backdrop')) {
        return dispatchEvent(step, 'uiTourShow');
    }

    return $q(function (resolve) {
        dispatchEvent(step, 'uiTourShow');
        $timeout(function () {
            uiTourBackdrop.createForElement(step.element, step.config('preventScrolling'), step.config('fixed'));
            resolve();
        }, step.config('popupDelay'));
    });

}).then(function () {

    step.element.addClass('ui-tour-active-step');

})
.....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants