After sorting a list, disabling it doesn't work properly. #27

Closed
michaelkonecny opened this Issue Jul 9, 2013 · 4 comments

2 participants

@michaelkonecny

Hi,

thank's for the plugin. It's awesome!

I just found one minor bug:
If you disable sorting of a list using .sortable('disable') BEFORE you change it's order, everything is ok, but if you change it's order first and THEN you disable it, nested lists don't seem to be fully disabled. This means they cannot be sorted, but if you try to do it, the arrow and the placeholder still show up.

One can reproduce this issue easily even on the plugin's webpage using the 'Toggable nested lists' example.

Tested on Firefox 22.0.

Hope this helps,
Michael

@michaelkonecny

The solution so far seems to be to iterate over all of the ul/ol elements that are concerned and use the .sortable('disable') or .sortable('enable') method for all of them.

Such as:
$("ol#mainList").sortable("enable");
$("ol#mainList ol").each(function(){
$(this).sortable("enable")
});

or
$("ol#mainList").sortable("disable");
$("ol#mainList ol").each(function(){
$(this).sortable("disable")
});

@johnny johnny added a commit that closed this issue Jul 15, 2013
@johnny Rewrote disable/enable logic
closes #27
26d7c4a
@johnny johnny closed this in 26d7c4a Jul 15, 2013
@johnny
Owner

Thanks for pointing this out. Please tell me if this worked for you.

@michaelkonecny
@michaelkonecny
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment