a5hik / ng-sortable

AngularJS Library for Drag and Drop, supports Sortable and Draggable. Supports Touch devices.
http://a5hik.github.io/ng-sortable/
MIT License
1.15k stars 314 forks source link

minor: handle should not have cursor: move if disabled #161

Open stromnet opened 9 years ago

stromnet commented 9 years ago

Hi,

thanks for your library, works great!

A minor issue: if my as-sortable has is-disabled set, the cursor on the as-sortable-item-handle will still be 'move', which is invalid since sorting has been disabled.

A solution would be a 'as-sortable-disabled' class on the as-sortable, and '.as-sortable-disabled .as-sortable-item-handle {cursor:auto;}' would sort it out, but I haven't used the full power of the library so I may miss scenarios where this is not good enough.

Thanks

a5hik commented 9 years ago

Yeah, that's a good point. Thanks.

rcrodrigues commented 9 years ago

I think that would also be good to provide a way to set the cursor as I want. In my case, I tried to change the cursor to pointer on the class .as-sortable-item-handle. No success. Every time I drag the element, the cursor changes to move. Maybe I'm missing something?

a5hik commented 9 years ago

@rcrodrigues the cursor: move is set as default option. the '.as-sortable-item-handle' is used as a constant, so overriding that would not work, you have to do it in a css source.

hbbh commented 8 years ago

A pretty gross work-around for this is to add a local style through ng-style ng-style="{'cursor' : (disabledFlag) ? 'pointer' : 'drag'}" on the element you're applying the 'as-sortable-item-handle' directive to.

+1 for the original suggestion of adding a class on the parent element that can be used as a selector to style the child elements.