r2017 - trunk/demos/sortable
Author: bohdan.ganicky
Date: Thu Feb 5 11:39:38 2009
New Revision: 2017
Added:
trunk/demos/sortable/connect-lists-through-tabs.html
Modified:
trunk/demos/sortable/index.html
Log:
demos/sortable/connect-lists-through-tabs: new demo created as a reaction
to a certain discussion in the jquery ui google group
Added: trunk/demos/sortable/connect-lists-through-tabs.html
==============================================================================
--- (empty file)
+++ trunk/demos/sortable/connect-lists-through-tabs.html Thu Feb 5
11:39:38 2009
@@ -0,0 +1,76 @@
+<!doctype html>
+<html lang="en">
+<head>
+ <title>jQuery UI Sortable - Connect lists with Tabs</title>
+ <link type="text/css" href="../../themes/base/ui.all.css"
rel="stylesheet" />
+ <script type="text/javascript" src="../../jquery-1.3.1.js"></script>
+ <script type="text/javascript" src="../../ui/ui.core.js"></script>
+ <script type="text/javascript" src="../../ui/ui.sortable.js"></script>
+ <script type="text/javascript" src="../../ui/ui.droppable.js"></script>
+ <script type="text/javascript" src="../../ui/ui.tabs.js"></script>
+ <link type="text/css" href="../demos.css" rel="stylesheet" />
+ <style type="text/css">
+ #sortable1 li, #sortable2 li { margin: 0 5px 5px 5px; padding: 5px;
font-size: 1.2em; width: 120px; }
+ </style>
+ <script type="text/javascript">
+ $(function() {
+ $("#sortable1, #sortable2").sortable({
+ }).disableSelection();
+
+ $("#tabs").tabs();
+
+ $("#tabs a").droppable({
+ accept: ".connectedSortable li",
+ drop: function(ev, ui) {
+ var $target = $($(this).attr('href')).find('.connectedSortable');
+ ui.draggable.hide('slow', function() {
+ $(this).prependTo($target).show();
+ });
+ }
+ });
+ });
+ </script>
+</head>
+<body>
+<div class="demo">
+
+<div id="tabs">
+ <ul>
+ <li><a href="#tabs-1">Nunc tincidunt</a></li>
+ <li><a href="#tabs-2">Proin dolor</a></li>
+ </ul>
+ <div id="tabs-1">
+ <ul id="sortable1" class="connectedSortable ui-helper-reset">
+ <li class="ui-state-default">Item 1</li>
+ <li class="ui-state-default">Item 2</li>
+ <li class="ui-state-default">Item 3</li>
+ <li class="ui-state-default">Item 4</li>
+ <li class="ui-state-default">Item 5</li>
+ </ul>
+ </div>
+ <div id="tabs-2">
+ <ul id="sortable2" class="connectedSortable ui-helper-reset">
+ <li class="ui-state-highlight">Item 1</li>
+ <li class="ui-state-highlight">Item 2</li>
+ <li class="ui-state-highlight">Item 3</li>
+ <li class="ui-state-highlight">Item 4</li>
+ <li class="ui-state-highlight">Item 5</li>
+ </ul>
+ </div>
+</div>
+
+</div><!-- End demo -->
+
+<div class="demo-description">
+
+
+ Sort items from one list into another and vice versa, by passing a
selector into
+ the <code>connectWith</code> option. The simplest way to do this is to
+ group all related lists with a CSS class, and then pass that class into
the
+ sortable function (i.e., <code>connectWith: '.myclass'</code>).
+
+
+</div><!-- End demo-description -->
+
+</body>
+</html>
Modified: trunk/demos/sortable/index.html
==============================================================================
--- trunk/demos/sortable/index.html (original)
+++ trunk/demos/sortable/index.html Thu Feb 5 11:39:38 2009
@@ -12,6 +12,7 @@
<li class="demo-config-on"><a href="default.html">Default
functionality</a></li>
<li><a href="placeholder.html">Drop placeholder</a></li>
<li><a href="connect-lists.html">Connect lists</a></li>
+ <li><a href="connect-lists-through-tabs.html">Connect lists through
tabs</a></li>
<li><a href="empty-lists.html">Handle empty lists</a></li>
<li><a href="items.html">Include / exclude items</a></li>
<li><a href="delay-start.html">Delay start</a></li>