Flux-Slider icon indicating copy to clipboard operation
Flux-Slider copied to clipboard

Timer not reset when user changes slides manually

Open nickdaugherty opened this issue 12 years ago • 4 comments

When using automatic transitions, the timer should be reset when the user changes slides on their own. Currently, the timer keeps going, leading to unexpected behavior if a user changes slides near the automatic transition time (ie, they choose the slide, and then very shortly after, it transitions again)

nickdaugherty avatar Mar 22 '12 01:03 nickdaugherty

Thanks for the ticket.

The desired behaviour is how you describe it so there must have been a bug introduced which prevents the timer from being reset.

I'll take a look

joelambert avatar Mar 22 '12 11:03 joelambert

Hi, I've encountered the same issue. Is there a known workaround?

NiclasLindqvist avatar Dec 03 '12 13:12 NiclasLindqvist

Easiest solution:

    showImage: function(index, trans, opts) {
        var restart = false;
        if(this.playing) {
            restart = true;
            this.stop();
        }
        this.setNextIndex(index);

        // Temporarily stop the transition interval
        //clearInterval(this.interval);
        //this.interval = null;

        this.setupImages();
        this.transition(trans, opts);
        if(restart == true) this.start();
    },  

AnonSphere avatar Dec 11 '12 20:12 AnonSphere

thansk for the fix, it works. would be nice to see this sorted in production code, have you submitted a PR?

wing5wong avatar Jul 03 '13 21:07 wing5wong