aboutsummaryrefslogtreecommitdiffstats
path: root/demos/sortable
diff options
context:
space:
mode:
authorBohdan Ganicky <bohdan.ganicky@gmail.com>2009-02-05 21:44:38 +0000
committerBohdan Ganicky <bohdan.ganicky@gmail.com>2009-02-05 21:44:38 +0000
commit81099914a90647e216d31356791ccb671d570103 (patch)
tree89fae18dbabbc2bd21d6b368b42508de6724ce55 /demos/sortable
parent915a3a41178ccd42d55798c7cc11ff5beedd27b9 (diff)
downloadjquery-ui-81099914a90647e216d31356791ccb671d570103.tar.gz
jquery-ui-81099914a90647e216d31356791ccb671d570103.zip
demos/sortable/connect-lists-through-tabs: finetuning + automatic tab switch after item is removed from the list
Diffstat (limited to 'demos/sortable')
-rw-r--r--demos/sortable/connect-lists-through-tabs.html14
1 files changed, 8 insertions, 6 deletions
diff --git a/demos/sortable/connect-lists-through-tabs.html b/demos/sortable/connect-lists-through-tabs.html
index d3a91a33c..1744c0eb9 100644
--- a/demos/sortable/connect-lists-through-tabs.html
+++ b/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');
});
}
});