mjsarfatti / nestedSortable

A jQuery plugin that extends Sortable UI functionalities to nested lists.
http://mjsarfatti.com/sandbox/nestedSortable
881 stars 533 forks source link

When 'disableNesting' is set, those elements still have drop zones #47

Open Fauntleroy opened 12 years ago

Fauntleroy commented 12 years ago

When I set disableNesting: 'file', it properly disables the specified class, but it doesn't disable the drop zone, leading to some very confusing user experience. Is there any way to disable a certain type of element AND disable its drop zone?

codeclown commented 12 years ago

I came here to post this same exact issue. Upvote!

mjsarfatti commented 12 years ago

The placeholder is still shown because you may want to style it, say, with a red background (see my demo) to hint the user that he can't drop there.

If you want to disable the drop zone you could try setting the placeholder height to 0... Anyway this feature request has been coming up a few times recently, a future update might include an option for disabling the drop zone altogether, but I can't say when.

dustinbolton commented 11 years ago

I came here to post this as well.

EDIT #1: I was able to emulate this exact behavior by setting "display: none;" on the error class. This completely hid the dropzone and removed its spot. This is exactly what I wanted.

disableNesting: 'notemenu_error'

 .notemenu_error {
    display: none;
 } 

EDIT #2: There is still a small problem with this method for nested items. It means when trying to sort and drop under an item nested under another item, when you are to the right of the tabSize value then you have no dropzone. The correct behaviour I believe would be for the dropzone within the tabSize area to extend fully to the right as if you were dropping below the above item and not trying to drop nested inside it. Essentially when an item has nesting disabled, I do not want it to detect a drop zone below it (even if I hide it with my CSS it still detects it) so that the dropzone from the parent can still appear there like it would normally if the nonest item was not existing. I hope that made sense; it's a bit difficult to explain. If you do add the feature to disable the drop zone please consider making it function as I describe if possible. Will feed hungry programmers for fix. :D

Thank you very very much for this great tool.

mjsarfatti commented 11 years ago

Hi Dustin, I got your point. It makes sense, it will definitely be part of version 2.0. Hopefully soon, by the end of next week.

gihrig commented 11 years ago

Thank you Manuele, I too would make use of this feature. I'm watching for version 2.0.

scriby commented 11 years ago

+1

mjsarfatti commented 11 years ago

https://github.com/mjsarfatti/nestedSortable/tree/2.0alpha

scriby commented 11 years ago

I noticed this and have it integrated and working.

Thanks!

mjsarfatti commented 11 years ago

Great :)

dustinbolton commented 11 years ago

Seems to work perfectly in the 2.0 alpha so far in my testing. I'll keep trying things out and customizing. Donating for the awesome work! :) Thank you.

dustinbolton commented 11 years ago

Discovered a single 2.0 alpha "glitch" that is similar / possibly related. Reproducible in demo for 2.0alpha: http://mjsarfatti.com/sandbox/nestedSortable/

Reproduction steps: 1) Pick up Item 2. 2) Hover it over Item 1 to expand it. 3) Hover it between Item 1 and Sub Item 1.1. (placeholder is now on same level and above Sub Item 1.1. 4) Move the mouse up so that you are hovering over the middle of Item 1. (the placeholder should stay in the same place). 5) Move the mouse back down to where the placeholder currently is. (the placeholder will now drop to the BOTTOM of this section rather than staying put).

It seems to be the issue happens whenever exiting the ol and re-entering it via the top. I played around with CSS a bit to see if I could work around the issue that way but no luck so far.

mjsarfatti commented 11 years ago

Sorry for replying late. Thanks for the bug report, will look into that! It's a minor glitch, so it won't get high priority...

2012/12/12 Dustin Bolton notifications@github.com

Discovered a single 2.0 alpha "glitch" that is similar / possibly related. Reproducible in demo for 2.0alpha: http://mjsarfatti.com/sandbox/nestedSortable/

Reproduction steps: 1) Pick up Item 2. 2) Hover it over Item 1 to expand it. 3) Hover it between Item 1 and Sub Item 1.1. (placeholder is now on same level and above Sub Item 1.1. 4) Move the mouse up so that you are hovering over the middle of Item 1. (the placeholder should stay in the same place). 5) Move the mouse back down to where the placeholder currently is. (the placeholder will now drop to the BOTTOM of this section rather than staying put).

It seems to be the issue happens whenever exiting the ol and re-entering it via the top. I played around with CSS a bit to see if I could work around the issue that way but no luck so far.

— Reply to this email directly or view it on GitHubhttps://github.com/mjsarfatti/nestedSortable/issues/47#issuecomment-11282391.