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

afterPhrase and afterAll not being called in all conditions #2

Open
jvivona opened this issue May 15, 2013 · 1 comment
Open

afterPhrase and afterAll not being called in all conditions #2

jvivona opened this issue May 15, 2013 · 1 comment
Labels

Comments

@jvivona
Copy link

jvivona commented May 15, 2013

have an edge case where we are trying a single phrase and setting endless to false (we get data from a service periodically). In this condition, afterPhrase and afterAll callbacks were not being invoked.. Made the following changes lines 48 - 55 - have testing under numerous conditions.

                if (i === text.length && !options.endless) {
                    if (typeof options.afterPhrase === 'function') options.afterPhrase();
                    return(typeof options.afterAll === 'function' ? options.afterAll() : null );
                } else if (i === text.length) {
                    i = 0;
                }
                timer = setTimeout(typetext, options.delay, i);
                if (typeof options.afterPhrase === 'function') options.afterPhrase(timer);
@oskarrough
Copy link

works here, thanks you.

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

No branches or pull requests

2 participants