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

animation flow backwards #9

Open
cescoferraro opened this issue Feb 13, 2017 · 0 comments
Open

animation flow backwards #9

cescoferraro opened this issue Feb 13, 2017 · 0 comments

Comments

@cescoferraro
Copy link

The animation flows backwards when setting the progress back to 0.
There should be some sort of reset method, that would maybe hide the progress when it goes back.
I am doing it inside my component, maybe thats something that could be dealt inside the progress component itself.

    Insert(event) {
        this.props.SET_INSERT_PROGRESS(0);
        this.props.SET_INSERT_PROGRESS(20);
        event.preventDefault();


        const body = {
            ...
        };

        const progressObserver = Rx.Observer.create(
            (x: ProgressEvent) => {
                console.log(x);
                console.log('Next: ' + x.total);
                let percentage = (x.loaded / x.total) * 100;
                console.log(percentage);
                this.props.SET_INSERT_PROGRESS(percentage)
            },
            (err) => {
                console.log('observerError: ' + err);
            },
            () => {
                this.props.SET_INSERT_PROGRESS(100);
                console.log('Completed');
            }
        );
        Rx.DOM.post({
            url: Utils.API_URL("/add"),
            body: Serialize(body),
            progressObserver: progressObserver
        }).subscribe(
            (xhr: XMLHttpRequest) => {
                let me: User = JSON.parse(xhr.response);
                this.showProgress = false;
                setTimeout(() => {
                    console.log("here");
                    this.props.SET_INSERT_PROGRESS(0);
                    this.showProgress = true;
                }, 500);

            });
    }
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

No branches or pull requests

1 participant