]> source.dussan.org Git - jquery-ui.git/commitdiff
Fixed #4551 - Sortable connectWith fails if item is floated. Props dhlavety and jlill...
authorRichard Worth <rdworth@gmail.com>
Tue, 7 Jul 2009 10:41:42 +0000 (10:41 +0000)
committerRichard Worth <rdworth@gmail.com>
Tue, 7 Jul 2009 10:41:42 +0000 (10:41 +0000)
tests/visual/sortable/sortable_ticket_4551.html [new file with mode: 0644]
ui/ui.sortable.js

diff --git a/tests/visual/sortable/sortable_ticket_4551.html b/tests/visual/sortable/sortable_ticket_4551.html
new file mode 100644 (file)
index 0000000..ba61e24
--- /dev/null
@@ -0,0 +1,51 @@
+<!doctype html>\r
+<html lang="en">\r
+<head>\r
+       <title>Sortable Visual Test : Sortable ticket #4551</title>\r
+       <link rel="stylesheet" href="../visual.css" type="text/css" />\r
+       <link rel="stylesheet" href="../../../themes/base/ui.all.css" type="text/css">\r
+       <script type="text/javascript" src="../../../jquery-1.3.2.js"></script>\r
+       <script type="text/javascript" src="../../../ui/ui.core.js"></script>\r
+       <script type="text/javascript" src="../../../ui/ui.sortable.js"></script>\r
+       <script type="text/javascript">\r
+       $(function() {\r
+               $("#first, #second").sortable({\r
+                       connectWith: '.sortable'\r
+               }).disableSelection();\r
+       });\r
+       </script>\r
+       <style type="text/css">\r
+               .sortable { margin: 0; padding: 0;  }\r
+               .sortable div { margin: 3px 3px 3px 0; background: #ccc; padding: 1px; border: 1px solid black; float:left; width: 100px; height: 140px; font-size: 1em; text-align: center; }\r
+               #second div { background: #acc; }\r
+       </style>\r
+</head>\r
+<body>\r
+\r
+<h1 class="ui-widget-header"><a href="http://dev.jqueryui.com/ticket/4551">#4551 - Sortable connectWith fails if item is floated</a></h1>\r
+\r
+<div id="first" class="sortable">\r
+       <div>1</div>\r
+       <div>2</div>\r
+       <div>3</div>\r
+       <div>4</div>\r
+       <div>5</div>\r
+       <div>6</div>\r
+       <div>7</div>\r
+       <div>8</div>\r
+       <div>9</div>\r
+       <div>10</div>\r
+       <div>11</div>\r
+       <div>12</div>\r
+</div>\r
+\r
+<br style="clear:both;">\r
+<hr />\r
+\r
+<div id="second" class="sortable">\r
+       <div>12</div>\r
+       <div>14</div>\r
+</div>\r
+\r
+</body>\r
+</html>\r
index 12f18b6196da211fd9bc2f9794020d9dbe492653..f2d5dc4ed8f35ff49e2eb5d4f85faa7a0d744796 100644 (file)
@@ -570,10 +570,6 @@ $.widget("ui.sortable", $.extend({}, $.ui.mouse, {
                for (var i = this.items.length - 1; i >= 0; i--){
                        var item = this.items[i];
 
-                       //We ignore calculating positions of all connected containers when we're not over them
-                       if(item.instance != this.currentContainer && this.currentContainer && item.item[0] != this.currentItem[0])
-                               continue;
-
                        var t = this.options.toleranceElement ? $(this.options.toleranceElement, item.item) : item.item;
 
                        if (!fast) {