aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Worth <rdworth@gmail.com>2009-07-07 10:41:42 +0000
committerRichard Worth <rdworth@gmail.com>2009-07-07 10:41:42 +0000
commit56b0da59d71396a740cf48a75902243d561ba186 (patch)
tree1487894d84ffd7eb7adcc0d4329ee85f0eb11b25
parentbf500e6b8bbe89ca3a07db83c5818dfafc500a5b (diff)
downloadjquery-ui-56b0da59d71396a740cf48a75902243d561ba186.tar.gz
jquery-ui-56b0da59d71396a740cf48a75902243d561ba186.zip
Fixed #4551 - Sortable connectWith fails if item is floated. Props dhlavety and jlillywhite.
-rw-r--r--tests/visual/sortable/sortable_ticket_4551.html51
-rw-r--r--ui/ui.sortable.js4
2 files changed, 51 insertions, 4 deletions
diff --git a/tests/visual/sortable/sortable_ticket_4551.html b/tests/visual/sortable/sortable_ticket_4551.html
new file mode 100644
index 000000000..ba61e244a
--- /dev/null
+++ b/tests/visual/sortable/sortable_ticket_4551.html
@@ -0,0 +1,51 @@
+<!doctype html>
+<html lang="en">
+<head>
+ <title>Sortable Visual Test : Sortable ticket #4551</title>
+ <link rel="stylesheet" href="../visual.css" type="text/css" />
+ <link rel="stylesheet" href="../../../themes/base/ui.all.css" type="text/css">
+ <script type="text/javascript" src="../../../jquery-1.3.2.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">
+ $(function() {
+ $("#first, #second").sortable({
+ connectWith: '.sortable'
+ }).disableSelection();
+ });
+ </script>
+ <style type="text/css">
+ .sortable { margin: 0; padding: 0; }
+ .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; }
+ #second div { background: #acc; }
+ </style>
+</head>
+<body>
+
+<h1 class="ui-widget-header"><a href="http://dev.jqueryui.com/ticket/4551">#4551 - Sortable connectWith fails if item is floated</a></h1>
+
+<div id="first" class="sortable">
+ <div>1</div>
+ <div>2</div>
+ <div>3</div>
+ <div>4</div>
+ <div>5</div>
+ <div>6</div>
+ <div>7</div>
+ <div>8</div>
+ <div>9</div>
+ <div>10</div>
+ <div>11</div>
+ <div>12</div>
+</div>
+
+<br style="clear:both;">
+<hr />
+
+<div id="second" class="sortable">
+ <div>12</div>
+ <div>14</div>
+</div>
+
+</body>
+</html>
diff --git a/ui/ui.sortable.js b/ui/ui.sortable.js
index 12f18b619..f2d5dc4ed 100644
--- a/ui/ui.sortable.js
+++ b/ui/ui.sortable.js
@@ -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) {