Skip to content
Permalink
Browse files

demos/sortable/connect-lists-through-tabs: finetuning + automatic tab…

… switch after item is removed from the list
  • Loading branch information
bganicky committed Feb 5, 2009
1 parent 915a3a4 commit 81099914a90647e216d31356791ccb671d570103
Showing with 8 additions and 6 deletions.
  1. +8 −6 demos/sortable/connect-lists-through-tabs.html
@@ -14,17 +14,19 @@
</style>
<script type="text/javascript">
$(function() {
$("#sortable1, #sortable2").sortable({
}).disableSelection();
$("#sortable1, #sortable2").sortable().disableSelection();

$("#tabs").tabs();
var $tabs = $("#tabs").tabs();

$("#tabs a").droppable({
var $tab_links = $("a",$tabs).droppable({
accept: ".connectedSortable li",
drop: function(ev, ui) {
var $target = $($(this).attr('href')).find('.connectedSortable');
var $link = $(this);
var $list = $($link.attr('href')).find('.connectedSortable');

ui.draggable.hide('slow', function() {
$(this).prependTo($target).show();
$tabs.tabs('select', $tab_links.index($link));
$(this).appendTo($list).show('slow');
});
}
});

0 comments on commit 8109991

Please sign in to comment.
You can’t perform that action at this time.