godswearhats / jquery-ui-rotatable

Adds a small handle to an HTML element to allow it to be rotated
MIT License
155 stars 103 forks source link

enable/disable not disabling rotatable #39

Closed JD-Robbs closed 7 years ago

JD-Robbs commented 8 years ago

Hi there,

Nifty little plugin!

I noticed that when using rotatable({disabled:true}) and rotatable('enable'), the plugin adds and removes the correct CSS-class state (.ui-rotatable-disabled).

That said, the respective element is, in fact, still rotatable despite the following code:

rotateElement: function(event) {
    if (!this.element || this.element.disabled) {
        return false;
    }
    [...]

Not sure why it isn't working, but maybe the disabled-flag is stored in an options object attached to the DOM element rather than the disabled property directly on it?

RedShift1 commented 8 years ago

Yep, seeing the same here

godswearhats commented 8 years ago

Thanks for reporting. I'll see if I can track down the bug in time for the 1.1 release on March 1st.

mkdizajn commented 8 years ago

Hi, I'm not sure if this is related to my problem, but I'm trying to make custom implementation for knob to rotate for 270 deg, and then to stop but I think that's not working as expected. The code that trubles me is in JS section on lines 22 - 25. Thanks for great plugin btw :)

http://codepen.io/mkdizajn/pen/KVYNbb?editors=1010

OK, one more thing,, I notice that while I mouse scroll over knob it gives me ok angle values, while the angles are negative if I drag it with a mouse.., oh no, the touch events are not captured right?

godswearhats commented 7 years ago

Fixed in PR #61