PixelsCommander / Propeller

JavaScript library to rotate elements with mouse or touch gestures. Supports inertia and stepwise rotation. Optimized for better performance.
http://pixelscommander.com/polygon/propeller/
409 stars 58 forks source link

onStop event firing 2 times. #8

Closed dmarcos89 closed 10 years ago

dmarcos89 commented 10 years ago

Hey, do you know why this is happening? Thanks in advance. Damian

new Propeller(document.getElementById("ruleta"), 
{
    inertia: 0.90, 
    onStop: function(){
        var angle = this.angle;
        var scope = angular.element($("#main")).scope();
        scope.$apply(function(){
            console.log(angle);
        })
    }
});
PixelsCommander commented 10 years ago

Seems that your app applies Propeller twice. Can you check this?

dmarcos89 commented 10 years ago

Hi Denis, thanks for your help, but i don´t think my app is applying 2 times for propeller... Will continue checking...

Apart from this, i have another question: i want to play a sound when rotation start (its a roulette). isn't there a method onStart right? How can i achieve it?

Thanks in advance, Damian

PixelsCommander commented 10 years ago

There are onDragStart and onDragStop callbacks to handle user actions. onStop fire when propeller is being stopped by friction.

Check out tests folder in repo. There is callbacks.html and it logs a bit to console. Let me know if onStop issue persists.