Hi,
I have two sortable lists and everything works fine unless one of the columns is empty.
For example if the left list is empty and the user tries to drag an item from the right list and drop it into the left list, the drop can not happen. It just returns back to it's spot in the right list.
If both right and left has items then it works just fine.
Has anyone seen this behavior? Or have ideas on how to fix it?
Here is the relevant code:
<ul id = "left">
<%@mods_left.each do |mod|
<li id = "item_<%=mod.id%>" class = "list-item">
<span class="list-title" ><%=truncate(h(mod.module_title) ,:length => 40) %></span> <span class = 'handle'><%=image_tag("/images/icons/move.png", :title => 'Drag and Drop', :alt => 'Drag and Drop', :border => 0)%> </span>
</li>
<% end %>
</ul>
<ul id = "right">
<%@mods_right.each do |mod|
<li id = "item_<%=mod.id%>" class = "list-item">
<span class="list-title" ><%=truncate(h(mod.module_title) ,:length => 40) %></span> <span class = 'handle'><%=image_tag("/images/icons/move.png", :title => 'Drag and Drop', :alt => 'Drag and Drop', :border => 0)%> </span>
</li>
<% end %>
</ul>
<%= sortable_element 'left',
:url => {:controller => 'tab', :action => "sort" },
:complete => visual_effect(:highlight, 'left'),
:handle => 'handle',
:containment => ['left', 'right'],
:constraint => false,
:dropOnEmpty => true %>
<%= sortable_element 'right',
:url => {:controller => 'tab', :action => "sort" },
:complete => visual_effect(:highlight, 'right'),
:handle => 'handle',
:containment => ['left', 'right'],
:constraint => false,
:dropOnEmpty => true %>