]> source.dussan.org Git - jquery-ui.git/commitdiff
demos/sortable: some cleanup and consistency
authorRichard Worth <rdworth@gmail.com>
Tue, 20 Jan 2009 13:12:22 +0000 (13:12 +0000)
committerRichard Worth <rdworth@gmail.com>
Tue, 20 Jan 2009 13:12:22 +0000 (13:12 +0000)
17 files changed:
demos/sortable/connect-lists.html
demos/sortable/connectwith.html [deleted file]
demos/sortable/default.html
demos/sortable/delay-start.html
demos/sortable/delay.html [deleted file]
demos/sortable/display-grid.html
demos/sortable/display-portlets.html [deleted file]
demos/sortable/distance.html [deleted file]
demos/sortable/droponempty.html [deleted file]
demos/sortable/droppable.html [deleted file]
demos/sortable/empty-lists.html
demos/sortable/floating.html [deleted file]
demos/sortable/index.html
demos/sortable/items.html
demos/sortable/placeholder.html
demos/sortable/portlets.html
demos/sortable/tolerance.html [deleted file]

index 569dbfa29ee118c453f658e4da29f3b2ddd85d46..6497b5fa1d84a5d2d6185e1504dcb8e917cb6b58 100644 (file)
@@ -8,8 +8,8 @@
        <script type="text/javascript" src="../../ui/ui.sortable.js"></script>
        <link type="text/css" href="../demos.css" rel="stylesheet" />
        <style type="text/css">
-       .demo ul { list-style-type: none; margin: 0; padding: 0; float: left; margin-right: 10px; }
-       .demo li { margin: 5px; padding: 5px; font-size: 1.2em; width: 120px; }
+       #sortable1, #sortable2 { list-style-type: none; margin: 0; padding: 0; float: left; margin-right: 10px; }
+       #sortable1 li, #sortable2 li { margin: 0 5px 5px 5px; padding: 5px; font-size: 1.2em; width: 120px; }
        </style>
        <script type="text/javascript">
        $(function() {
 
 <div class="demo-description">
 
-<p>Sort items from one list into another and vice versa passing an array into the <strong>connectWith</strong> 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 using array notation (i.e., connectWith: ['.myclass']).</p>
+<p>
+       Sort items from one list into another and vice versa, by passing an array 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 using array notation (i.e., <code>connectWith: ['.myclass']</code>).
+</p>
 
 </div><!-- End demo-description -->
 
diff --git a/demos/sortable/connectwith.html b/demos/sortable/connectwith.html
deleted file mode 100644 (file)
index b3f21d0..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-<!doctype html>
-<html lang="en">
-<head>
-       <title>jQuery UI Sortable - Connecting Two Lists Demo</title>
-       <link type="text/css" href="../../themes/base/ui.all.css" rel="stylesheet" />
-       <script type="text/javascript" src="../../jquery-1.3.js"></script>
-       <script type="text/javascript" src="../../ui/ui.core.js"></script>
-       <script type="text/javascript" src="../../ui/ui.sortable.js"></script>
-       <link type="text/css" href="../demos.css" rel="stylesheet" />
-       <style type="text/css">
-       .demo ul { list-style-type: none; margin: 0; padding: 0; float: left; margin-right: 10px; }
-       .demo li { margin: 5px; padding: 5px; font-size: 1.2em; width: 120px; }
-       </style>
-       <script type="text/javascript">
-       $(function() {
-               $("#sortable1, #sortable2").sortable({
-                       connectWith: ['.connectedSortable']
-               });
-       });
-       </script>
-</head>
-<body>
-<div class="demo">
-
-<ul id="sortable1" class="connectedSortable">
-       <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>
-
-<ul id="sortable2" class="connectedSortable">
-       <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><!-- End demo -->
-
-<div class="demo-description">
-
-<p>
-
-</p>
-
-</div><!-- End demo-description -->
-
-</body>
-</html>
index bd58f499474478d40ed45ac48b61b2d163b6b550..dab3907ded696ac93e8a70524602a1a01f28cea6 100644 (file)
@@ -9,7 +9,7 @@
        <link type="text/css" href="../demos.css" rel="stylesheet" />
        <style type="text/css">
        #sortable { list-style-type: none; margin: 0; padding: 0; width: 60%; }
-       #sortable li { margin: 3px; padding: 0.4em; padding-left: 1.5em; font-size: 1.4em; height: 18px; }
+       #sortable li { margin: 0 3px 3px 3px; padding: 0.4em; padding-left: 1.5em; font-size: 1.4em; height: 18px; }
        #sortable li span { position: absolute; margin-left: -1.3em; }
        </style>
        <script type="text/javascript">
 
 <div class="demo-description">
 
-<p>Enable a group of DOM elements to be sortable. Click on and drag and element to a new spot within the list, and the other items will adjust to fit. By default, sortable items share <strong>draggable</strong> properties.</p>
+<p>
+       Enable a group of DOM elements to be sortable. Click on and drag an
+       element to a new spot within the list, and the other items will adjust to
+       fit. By default, sortable items share <strong>draggable</strong> properties.
+</p>
 
 </div><!-- End demo-description -->
 
index 9952c830ed1a4733b668266b7952da9384255e66..f5b1cc980a73f9627902547e936840f37c7a947f 100644 (file)
@@ -8,34 +8,36 @@
        <script type="text/javascript" src="../../ui/ui.sortable.js"></script>
        <link type="text/css" href="../demos.css" rel="stylesheet" />
        <style type="text/css">
-       .demo ul { list-style-type: none; margin: 0; padding: 0; margin-bottom: 15px; }
-       .demo li { margin: 5px; padding: 5px; font-size: 1.2em; }
+       #sortable1, #sortable2 { list-style-type: none; margin: 0; padding: 0; margin-bottom: 15px; }
+       #sortable1 li, #sortable2 li { margin: 0 5px 5px 5px; padding: 5px; font-size: 1.2em; }
        </style>
        <script type="text/javascript">
        $(function() {
-               $("#sortable").sortable({
-                       delay: 1000
+               $("#sortable1").sortable({
+                       delay: 300
                });
                
                $("#sortable2").sortable({
-                       distance: 50
+                       distance: 15
                });
+
+               $("li").disableSelection();
        });
        </script>
 </head>
 <body>
 <div class="demo">
 
-<h3 class="docs">Time delay of 1000ms:</h3>
+<h3 class="docs">Time delay of 300ms:</h3>
 
-<ul id="sortable">
+<ul id="sortable1">
        <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>
 </ul>
 
-<h3>Distance delay of 50px:</h3>
+<h3 class="docs">Distance delay of 15px:</h3>
 
 <ul id="sortable2">
        <li class="ui-state-default">Item 1</li>
 
 <div class="demo-description">
 
-<p>Delay the start of sorting for a number of milliseconds with the <strong>delay</strong> option; prevent sorting until the cursor is held down and dragged a specifed number of pixels with the <strong>distance</strong> option. </p>
+<p>
+       Prevent accidental sorting either by delay (time) or distance. Set a number of
+       milliseconds the element needs to be dragged before sorting starts
+       with the <code>delay</code> option. Set a distance in pixels the element
+       needs to be dragged before sorting starts with the <code>distance</code>
+       option.
+</p>
 
 </div><!-- End demo-description -->
 
diff --git a/demos/sortable/delay.html b/demos/sortable/delay.html
deleted file mode 100644 (file)
index 2b9a099..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-<!doctype html>
-<html lang="en">
-<head>
-       <title>jQuery UI Sortable - Delay / Distance Demo</title>
-       <link type="text/css" href="../../themes/base/ui.all.css" rel="stylesheet" />
-       <script type="text/javascript" src="../../jquery-1.3.js"></script>
-       <script type="text/javascript" src="../../ui/ui.core.js"></script>
-       <script type="text/javascript" src="../../ui/ui.sortable.js"></script>
-       <link type="text/css" href="../demos.css" rel="stylesheet" />
-       <style type="text/css">
-       .demo ul { list-style-type: none; margin: 0; padding: 0; margin-bottom: 15px; }
-       .demo li { margin: 5px; padding: 5px; font-size: 1.2em; }
-       </style>
-       <script type="text/javascript">
-       $(function() {
-               $("#sortable").sortable({
-                       delay: 1000
-               });
-       });
-       </script>
-</head>
-<body>
-<div class="demo">
-
-<p>Delay of 1000ms</p>
-
-<ul id="sortable">
-       <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><!-- End demo -->
-
-<div class="demo-description">
-
-<p>
-
-</p>
-
-</div><!-- End demo-description -->
-
-</body>
-</html>
index c0081a3cb6359bd690527c6d66a6bf7d9e20e089..7435f60e7e15996e8b3e3d95032e0845d258c86b 100644 (file)
 
 <div class="demo-description">
 
-<p>To arrange sortable items as a grid, give them identical dimensions and float them using CSS.</p>
+<p>
+       To arrange sortable items as a grid, give them identical dimensions and
+       float them using CSS.
+</p>
 
 </div><!-- End demo-description -->
 
diff --git a/demos/sortable/display-portlets.html b/demos/sortable/display-portlets.html
deleted file mode 100644 (file)
index c71dcd2..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-<!doctype html>
-<html lang="en">
-<head>
-       <title>jQuery UI Sortable - Display as portlets</title>
-       <link type="text/css" href="../../themes/base/ui.all.css" rel="stylesheet" />
-       <script type="text/javascript" src="../../jquery-1.3.js"></script>
-       <script type="text/javascript" src="../../ui/ui.core.js"></script>
-       <script type="text/javascript" src="../../ui/ui.sortable.js"></script>
-       <link type="text/css" href="../demos.css" rel="stylesheet" />
-       <style type="text/css">
-       .column { width: 170px; float: left; padding-bottom: 100px; }
-       .portlet { margin: 1em; }
-       .portlet-header { margin: 0.3em; padding-left: 0.2em; }
-       .portlet-header .ui-icon { float: right; }
-       .portlet-content { padding: 0.4em; }
-       .ui-sortable-placeholder { border: 1px dotted black; visibility: visible !important; }
-       .ui-sortable-placeholder * { visibility: hidden; }
-       </style>
-       <script type="text/javascript">
-       $(function() {
-               $(".column").sortable({
-                       connectWith: ['.column']
-               });
-
-               $(".portlet").addClass("ui-widget ui-widget-content ui-helper-clearfix ui-corner-all")
-                       .find(".portlet-header")
-                               .addClass("ui-widget-header ui-corner-all")
-                               .prepend('<span class="ui-icon ui-icon-plusthick"></span>')
-                               .end()
-                       .find(".portlet-content");
-
-               $(".portlet-header .ui-icon").click(function() {
-                       $(this).toggleClass("ui-icon-minusthick");
-                       $(this).parents(".portlet:first").find(".portlet-content").toggle();
-               });
-       });
-       </script>
-</head>
-<body>
-<div class="demo">
-
-<div class="column">
-
-<div class="portlet">
- <div class="portlet-header">Feeds</div>
- <div class="portlet-content">Lorem ipsum dolor sit amet, consectetuer adipiscing elit</div>
-</div>
-
-<div class="portlet">
- <div class="portlet-header">News</div>
- <div class="portlet-content">Lorem ipsum dolor sit amet, consectetuer adipiscing elit</div>
-</div>
-
-</div>
-
-<div class="column">
-
-<div class="portlet">
- <div class="portlet-header">Shopping</div>
- <div class="portlet-content">Lorem ipsum dolor sit amet, consectetuer adipiscing elit</div>
-</div>
-
-</div>
-
-<div class="column">
-
-<div class="portlet">
- <div class="portlet-header">Links</div>
- <div class="portlet-content">Lorem ipsum dolor sit amet, consectetuer adipiscing elit</div>
-</div>
-
-<div class="portlet">
- <div class="portlet-header">Images</div>
- <div class="portlet-content">Lorem ipsum dolor sit amet, consectetuer adipiscing elit</div>
-</div>
-
-</div>
-
-</div><!-- End demo -->
-
-<div class="demo-description">
-
-<p>Enable portlets (styled divs) as sortables and use the <strong>connectWith</strong> option to allow sorting between columns.</p>
-
-</div><!-- End demo-description -->
-
-</body>
-</html>
diff --git a/demos/sortable/distance.html b/demos/sortable/distance.html
deleted file mode 100644 (file)
index 4e458c4..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-<!doctype html>
-<html lang="en">
-<head>
-       <title>jQuery UI Sortable - Delay / Distance Demo</title>
-       <link type="text/css" href="../../themes/base/ui.all.css" rel="stylesheet" />
-       <script type="text/javascript" src="../../jquery-1.3.js"></script>
-       <script type="text/javascript" src="../../ui/ui.core.js"></script>
-       <script type="text/javascript" src="../../ui/ui.sortable.js"></script>
-       <link type="text/css" href="../demos.css" rel="stylesheet" />
-       <style type="text/css">
-       .demo ul { list-style-type: none; margin: 0; padding: 0; margin-bottom: 15px; }
-       .demo li { margin: 5px; padding: 5px; font-size: 1.2em; }
-       </style>
-       <script type="text/javascript">
-       $(function() {
-               $("#sortable").sortable({
-                       distance: 50
-               });
-       });
-       </script>
-</head>
-<body>
-<div class="demo">
-
-<p>Distance of 50px</p>
-
-<ul id="sortable">
-       <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><!-- End demo -->
-
-<div class="demo-description">
-
-<p>
-
-</p>
-
-</div><!-- End demo-description -->
-
-</body>
-</html>
diff --git a/demos/sortable/droponempty.html b/demos/sortable/droponempty.html
deleted file mode 100644 (file)
index 1a548c0..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-<!doctype html>
-<html lang="en">
-<head>
-       <title>jQuery UI Sortable - Dropping on Empty Lists Demo</title>
-       <link type="text/css" href="../../themes/base/ui.all.css" rel="stylesheet" />
-       <script type="text/javascript" src="../../jquery-1.3.js"></script>
-       <script type="text/javascript" src="../../ui/ui.core.js"></script>
-       <script type="text/javascript" src="../../ui/ui.sortable.js"></script>
-       <link type="text/css" href="../demos.css" rel="stylesheet" />
-       <style type="text/css">
-       .demo ul { list-style-type: none; margin: 0; padding: 0; float: left; margin-right: 10px; background: #eee; padding: 5px; width: 143px;}
-       .demo li { margin: 5px; padding: 5px; font-size: 1.2em; width: 120px; }
-       </style>
-       <script type="text/javascript">
-       $(function() {
-               $("ul.droptrue").sortable({
-                       connectWith: ['ul']
-               });
-
-               $("ul.dropfalse").sortable({
-                       connectWith: ['ul'],
-                       dropOnEmpty: false
-               });
-       });
-       </script>
-</head>
-<body>
-<div class="demo">
-
-<ul class='droptrue'>
-       <li class="ui-state-default">Can be dropped..</li>
-       <li class="ui-state-default">..on an empty list</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>
-
-<ul class='dropfalse'>
-       <li class="ui-state-highlight">Cannot be dropped..</li>
-       <li class="ui-state-highlight">..on an empty list</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>
-
-<ul class='droptrue'>
-</ul>
-
-<br clear="both" />
-
-</div><!-- End demo -->
-
-<div class="demo-description">
-
-<p>
-
-</p>
-
-</div><!-- End demo-description -->
-
-</body>
-</html>
diff --git a/demos/sortable/droppable.html b/demos/sortable/droppable.html
deleted file mode 100644 (file)
index 953e7ef..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-<!doctype html>
-<html lang="en">
-<head>
-       <title>jQuery UI Sortable - Connect to Droppables Demo</title>
-       <link type="text/css" href="../../themes/base/ui.all.css" rel="stylesheet" />
-       <script type="text/javascript" src="../../jquery-1.3.js"></script>
-       <script type="text/javascript" src="../../ui/ui.core.js"></script>
-       <script type="text/javascript" src="../../ui/ui.droppable.js"></script>
-       <script type="text/javascript" src="../../ui/ui.sortable.js"></script>
-       <link type="text/css" href="../demos.css" rel="stylesheet" />
-       <style type="text/css">
-       #sortable { list-style-type: none; margin: 0; padding: 0; }
-       #sortable li { margin: 5px; padding: 5px; font-size: 1.2em; width: 150px; }
-       #droppable { height: 80px; margin-bottom: 10px; padding: 5px; float: right; width: 200px; }
-       </style>
-       <script type="text/javascript">
-       $(function() {
-               $("#sortable").sortable();
-               $("#droppable").droppable({
-                       activeClass: 'ui-state-hover',
-                       hoverClass: 'ui-state-active',
-                       drop: function(event, ui) {
-                               $(this).addClass('ui-state-highlight').find('p').html('Dropped!');
-                       }
-               });
-       });
-       </script>
-</head>
-<body>
-<div class="demo">
-
-<div id="droppable" class="ui-widget-header">
-       <p>Drop a list item on me - sortable items are automatically connected to droppables.</p>
-</div>
-
-<ul id="sortable">
-       <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><!-- End demo -->
-
-<div class="demo-description">
-
-<p>
-
-</p>
-
-</div><!-- End demo-description -->
-
-</body>
-</html>
index 7c66515ebaac3a1d73cc615a7c00da839a2c53f4..426c0ce6a6f069cc5fe1f62d4dc4489512018a9a 100644 (file)
@@ -8,8 +8,8 @@
        <script type="text/javascript" src="../../ui/ui.sortable.js"></script>
        <link type="text/css" href="../demos.css" rel="stylesheet" />
        <style type="text/css">
-       .demo ul { list-style-type: none; margin: 0; padding: 0; float: left; margin-right: 10px; background: #eee; padding: 5px; width: 143px;}
-       .demo li { margin: 5px; padding: 5px; font-size: 1.2em; width: 120px; }
+       #sortable1, #sortable2, #sortable3 { list-style-type: none; margin: 0; padding: 0; float: left; margin-right: 10px; background: #eee; padding: 5px; width: 143px;}
+       #sortable1 li, #sortable2 li, #sortable3 li { margin: 5px; padding: 5px; font-size: 1.2em; width: 120px; }
        </style>
        <script type="text/javascript">
        $(function() {
@@ -27,7 +27,7 @@
 <body>
 <div class="demo">
 
-<ul class='droptrue'>
+<ul id="sortable1" class='droptrue'>
        <li class="ui-state-default">Can be dropped..</li>
        <li class="ui-state-default">..on an empty list</li>
        <li class="ui-state-default">Item 3</li>
@@ -35,7 +35,7 @@
        <li class="ui-state-default">Item 5</li>
 </ul>
 
-<ul class='dropfalse'>
+<ul id="sortable2" class='dropfalse'>
        <li class="ui-state-highlight">Cannot be dropped..</li>
        <li class="ui-state-highlight">..on an empty list</li>
        <li class="ui-state-highlight">Item 3</li>
@@ -43,7 +43,7 @@
        <li class="ui-state-highlight">Item 5</li>
 </ul>
 
-<ul class='droptrue'>
+<ul id="sortable3" class='droptrue'>
 </ul>
 
 <br clear="both" />
 
 <div class="demo-description">
 
-<p>Prevent all items in a list from being dropped into a separate, empty list using the <strong>dropOnEmpty</strong> option set to false.  By default, sortable items can be dropped on empty lists.</p>
+<p>
+       Prevent all items in a list from being dropped into a separate, empty list
+       using the <code>dropOnEmpty</code> option set to <code>false</code>.  By default,
+       sortable items can be dropped on empty lists.
+</p>
 
 </div><!-- End demo-description -->
 
diff --git a/demos/sortable/floating.html b/demos/sortable/floating.html
deleted file mode 100644 (file)
index 8ad082b..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-<!doctype html>
-<html lang="en">
-<head>
-       <title>jQuery UI Sortable - Floating Demo</title>
-       <link type="text/css" href="../../themes/base/ui.all.css" rel="stylesheet" />
-       <script type="text/javascript" src="../../jquery-1.3.js"></script>
-       <script type="text/javascript" src="../../ui/ui.core.js"></script>
-       <script type="text/javascript" src="../../ui/ui.sortable.js"></script>
-       <link type="text/css" href="../demos.css" rel="stylesheet" />
-       <style type="text/css">
-       #sortable { list-style-type: none; margin: 0; padding: 0; }
-       #sortable li { margin: 3px; padding: 1px; float: left; width: 100px; height: 90px; font-size: 4em; text-align: center; }
-       </style>
-       <script type="text/javascript">
-       $(function() {
-               $("#sortable").sortable();
-       });
-       </script>
-</head>
-<body>
-<div class="demo">
-
-<ul id="sortable">
-       <li class="ui-state-default">1</li>
-       <li class="ui-state-default">2</li>
-       <li class="ui-state-default">3</li>
-       <li class="ui-state-default">4</li>
-       <li class="ui-state-default">5</li>
-       <li class="ui-state-default">6</li>
-       <li class="ui-state-default">7</li>
-       <li class="ui-state-default">8</li>
-       <li class="ui-state-default">9</li>
-       <li class="ui-state-default">10</li>
-       <li class="ui-state-default">11</li>
-       <li class="ui-state-default">12</li>
-</ul>
-
-</div><!-- End demo -->
-
-<div class="demo-description">
-
-<p>
-
-</p>
-
-</div><!-- End demo-description -->
-
-</body>
-</html>
index 0c3bd71968ce4107f990edc6349ea52854eb120a..e19c83f2b60fae8aa7103fd7590d0e07c3e211be 100644 (file)
        <h4>Examples</h4>
        <ul>
                <li class="demo-config-on"><a href="default.html">Default functionality</a></li>
-               <li><a href="tolerance.html">Drop tolerance (stickiness)</a></li>
                <li><a href="placeholder.html">Drop placeholder</a></li>
                <li><a href="connect-lists.html">Connect lists</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="items.html">Include / exclude items</a></li>
                <li><a href="delay-start.html">Delay start</a></li>
-               <li><a href="display-portlets.html">Display as portlets</a></li>
                <li><a href="display-grid.html">Display as grid</a></li>                
+               <li><a href="portlets.html">Portlets</a></li>
        </ul>
 </div>
 
index 54b63ed8a82b628c9b24a5cf01b2e306feaa7e6f..9664ae3dbc076311b3810c28de2c4799da7c86df 100644 (file)
@@ -8,33 +8,36 @@
        <script type="text/javascript" src="../../ui/ui.sortable.js"></script>
        <link type="text/css" href="../demos.css" rel="stylesheet" />
        <style type="text/css">
-       #sortable, #sortable2 { list-style-type: none; margin: 0; padding: 0; }
-       .demo li { margin: 5px; padding: 3px; font-size: 1.2em; }
+       #sortable1, #sortable2 { list-style-type: none; margin: 0; padding: 0; }
+       #sortable1 li, #sortable2 li { margin: 0 5px 5px 5px; padding: 3px; }
        </style>
        <script type="text/javascript">
        $(function() {
-               $("#sortable").sortable({
+               $("#sortable1").sortable({
                        items: 'li:not(.ui-state-disabled)'
                });
+
                $("#sortable2").sortable({
                        cancel: '.ui-state-disabled'
                });
+
+               $("#sortable1 li, #sortable2 li").disableSelection();           
        });
        </script>
 </head>
 <body>
 <div class="demo">
 
-<h3>Specify which items are sortable:</h3>
+<h3 class="docs">Specify which items are sortable:</h3>
 
-<ul id="sortable">
+<ul id="sortable1">
        <li class="ui-state-default">Item 1</li>
        <li class="ui-state-default ui-state-disabled">(I'm not sortable or a drop target)</li>
        <li class="ui-state-default ui-state-disabled">(I'm not sortable or a drop target)</li>
        <li class="ui-state-default">Item 4</li>
 </ul>
 
-<h3>Cancel sorting (but keep as drop targets):</h3>
+<h3 class="docs">Cancel sorting (but keep as drop targets):</h3>
 
 <ul id="sortable2">
        <li class="ui-state-default">Item 1</li>
 
 <div class="demo-description">
 
-<p>Specify which items are eligible to sort by passing a jQuery selector into the <strong>items</strong> option. Items excluded from this option are not sortable, nor are they valid targets for sortable items. </p>
-<p>To only prevent sorting on certain items, pass a jQuery selector into the <strong>cancel</strong> option.  Cancelled items remain valid sort targets for others.</p>
+<p>
+       Specify which items are eligible to sort by passing a jQuery selector into
+       the <code>items</code> option. Items excluded from this option are not
+       sortable, nor are they valid targets for sortable items.
+</p>
+
+<p>
+       To only prevent sorting on certain items, pass a jQuery selector into the
+       <code>cancel</code> option. Cancelled items remain valid sort targets for
+       others.
+</p>
 
 </div><!-- End demo-description -->
 
index 057297282b1f78d4477bf11ef4431298aec50900..0f46dac7d9fe7a374cd90a1aacc739d775d39003 100644 (file)
@@ -9,7 +9,9 @@
        <link type="text/css" href="../demos.css" rel="stylesheet" />
        <style type="text/css">
        #sortable { list-style-type: none; margin: 0; padding: 0; width: 60%; }
-       #sortable li { margin: 5px; padding: 5px; font-size: 1.2em; }
+       #sortable li { margin: 0 5px 5px 5px; padding: 5px; font-size: 1.2em; }
+       html>body #sortable li { height: 1.5em; line-height: 1.2em; }
+       .ui-state-highlight { height: 1.5em; line-height: 1.2em; }
        </style>
        <script type="text/javascript">
        $(function() {
 
 <div class="demo-description">
 
-<p>When dragging a sortable item to a new location, other items will make room for the that item by shifting to allow white space between them. Pass a class into the <strong>placeholder</strong> option to style that space to be visible.  Use the boolean <strong>forcePlaceholderSize</strong> option to set dimensions on the placeholder.</p>
+<p>
+       When dragging a sortable item to a new location, other items will make room
+       for the that item by shifting to allow white space between them. Pass a
+       class into the <code>placeholder</code> option to style that space to
+       be visible.  Use the boolean <code>forcePlaceholderSize</code> option
+       to set dimensions on the placeholder.
+</p>
 
 </div><!-- End demo-description -->
 
index 95dc40e11537f761dc8f3fe6dd008b079a23fa50..0368199806f0deec89d8fb27bd9c7be417d28e2f 100644 (file)
@@ -1,7 +1,7 @@
 <!doctype html>
 <html lang="en">
 <head>
-       <title>jQuery UI Sortable - Portlets Demo</title>
+       <title>jQuery UI Sortable - Portlets</title>
        <link type="text/css" href="../../themes/base/ui.all.css" rel="stylesheet" />
        <script type="text/javascript" src="../../jquery-1.3.js"></script>
        <script type="text/javascript" src="../../ui/ui.core.js"></script>
@@ -9,11 +9,11 @@
        <link type="text/css" href="../demos.css" rel="stylesheet" />
        <style type="text/css">
        .column { width: 170px; float: left; padding-bottom: 100px; }
-       .portlet { margin: 1em; }
-       .portlet-header { margin: 0.3em; padding-left: 0.2em; }
+       .portlet { margin: 0 1em 1em 1em; }
+       .portlet-header { margin: 0.3em; padding-bottom: 4px; padding-left: 0.2em; }
        .portlet-header .ui-icon { float: right; }
        .portlet-content { padding: 0.4em; }
-       .ui-sortable-placeholder { border: 1px dotted black; visibility: visible !important; }
+       .ui-sortable-placeholder { border: 1px dotted black; visibility: visible !important; height: 50px !important; }
        .ui-sortable-placeholder * { visibility: hidden; }
        </style>
        <script type="text/javascript">
 
 <div class="column">
 
-<div class="portlet">
- <div class="portlet-header">Feeds</div>
- <div class="portlet-content">Lorem ipsum dolor sit amet, consectetuer adipiscing elit</div>
-</div>
-
-<div class="portlet">
- <div class="portlet-header">News</div>
- <div class="portlet-content">Lorem ipsum dolor sit amet, consectetuer adipiscing elit</div>
-</div>
+       <div class="portlet">
              <div class="portlet-header">Feeds</div>
              <div class="portlet-content">Lorem ipsum dolor sit amet, consectetuer adipiscing elit</div>
+       </div>
+       
+       <div class="portlet">
              <div class="portlet-header">News</div>
              <div class="portlet-content">Lorem ipsum dolor sit amet, consectetuer adipiscing elit</div>
+       </div>
 
 </div>
 
 <div class="column">
 
-<div class="portlet">
- <div class="portlet-header">Shopping</div>
- <div class="portlet-content">Lorem ipsum dolor sit amet, consectetuer adipiscing elit</div>
-</div>
+       <div class="portlet">
              <div class="portlet-header">Shopping</div>
              <div class="portlet-content">Lorem ipsum dolor sit amet, consectetuer adipiscing elit</div>
+       </div>
 
 </div>
 
 <div class="column">
 
-<div class="portlet">
- <div class="portlet-header">Links</div>
- <div class="portlet-content">Lorem ipsum dolor sit amet, consectetuer adipiscing elit</div>
-</div>
-
-<div class="portlet">
- <div class="portlet-header">Images</div>
- <div class="portlet-content">Lorem ipsum dolor sit amet, consectetuer adipiscing elit</div>
-</div>
+       <div class="portlet">
              <div class="portlet-header">Links</div>
              <div class="portlet-content">Lorem ipsum dolor sit amet, consectetuer adipiscing elit</div>
+       </div>
+       
+       <div class="portlet">
              <div class="portlet-header">Images</div>
              <div class="portlet-content">Lorem ipsum dolor sit amet, consectetuer adipiscing elit</div>
+       </div>
 
 </div>
 
@@ -81,7 +81,8 @@
 <div class="demo-description">
 
 <p>
-
+       Enable portlets (styled divs) as sortables and use the <code>connectWith</code>
+       option to allow sorting between columns.
 </p>
 
 </div><!-- End demo-description -->
diff --git a/demos/sortable/tolerance.html b/demos/sortable/tolerance.html
deleted file mode 100644 (file)
index f9ad401..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-<!doctype html>
-<html lang="en">
-<head>
-       <title>jQuery UI Sortable - Drop tolerance (stickiness)</title>
-       <link type="text/css" href="../../themes/base/ui.all.css" rel="stylesheet" />
-       <script type="text/javascript" src="../../jquery-1.3.js"></script>
-       <script type="text/javascript" src="../../ui/ui.core.js"></script>
-       <script type="text/javascript" src="../../ui/ui.sortable.js"></script>
-       <link type="text/css" href="../demos.css" rel="stylesheet" />
-       <style type="text/css">
-       #sortable-tolerance-default, #sortable-tolerance-pointer { list-style-type: none; margin: 0; padding: 0; float: left; }
-       #sortable-tolerance-default li, #sortable-tolerance-pointer li { margin: 3px; padding: 1px; float: left; width: 100px; height: 90px; font-size: 1.3em; text-align: center; }
-       </style>
-       <script type="text/javascript">
-       $(function() {
-               $("#sortable-tolerance-default").sortable({
-                       tolerance: 'default'
-               });
-               $("#sortable-tolerance-pointer").sortable({
-                       tolerance: 'pointer'
-               });
-       });
-       </script>
-</head>
-<body>
-<div class="demo">
-
-<ul id="sortable-tolerance-default">
-       <li class="ui-state-default"><div class="ui-icon ui-icon-arrow-4"></div>Default tolerance</li>
-       <li class="ui-state-default"><div class="ui-icon ui-icon-arrow-4"></div>2</li>
-       <li class="ui-state-default"><div class="ui-icon ui-icon-arrow-4"></div>3</li>
-</ul>
-
-<br style="clear:both;" />
-<br style="clear:both;" />
-
-<ul id="sortable-tolerance-pointer">
-       <li class="ui-state-default"><div class="ui-icon ui-icon-arrowthick-1-ne"></div>Pointer tolerance</li>
-       <li class="ui-state-default"><div class="ui-icon ui-icon-arrowthick-1-ne"></div>2</li>
-       <li class="ui-state-default"><div class="ui-icon ui-icon-arrowthick-1-ne"></div>3</li>
-</ul>
-
-</div><!-- End demo -->
-
-<div class="demo-description">
-
-<p>Set the stickiness of drop areas using the <strong>tolerance</strong> option. Specify whether the drop should occur when either the pointer or intersection (mid-point of the sortable item) crosses the drop area's boundary. By default, the script guesses which option is best to use for each drag.</p>
-
-</div><!-- End demo-description -->
-
-</body>
-</html>