ng-sortable icon indicating copy to clipboard operation
ng-sortable copied to clipboard

minor: handle should not have cursor: move if disabled

Open stromnet opened this issue 9 years ago • 4 comments

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

stromnet avatar May 20 '15 13:05 stromnet

Yeah, that's a good point. Thanks.

a5hik avatar Jun 04 '15 12:06 a5hik

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?

rcrodrigues avatar Aug 25 '15 14:08 rcrodrigues

@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.

a5hik avatar Aug 26 '15 10:08 a5hik

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.

hbbh avatar Jul 14 '16 09:07 hbbh