Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #4551 - Sortable connectWith fails if item is floated. Props dh…

…lavety and jlillywhite.
  • Loading branch information...
commit 56b0da59d71396a740cf48a75902243d561ba186 1 parent bf500e6
Richard D. Worth authored July 07, 2009
51  tests/visual/sortable/sortable_ticket_4551.html
... ...
@@ -0,0 +1,51 @@
  1
+<!doctype html>
  2
+<html lang="en">
  3
+<head>
  4
+	<title>Sortable Visual Test : Sortable ticket #4551</title>
  5
+	<link rel="stylesheet" href="../visual.css" type="text/css" />
  6
+	<link rel="stylesheet" href="../../../themes/base/ui.all.css" type="text/css">
  7
+	<script type="text/javascript" src="../../../jquery-1.3.2.js"></script>
  8
+	<script type="text/javascript" src="../../../ui/ui.core.js"></script>
  9
+	<script type="text/javascript" src="../../../ui/ui.sortable.js"></script>
  10
+	<script type="text/javascript">
  11
+	$(function() {
  12
+		$("#first, #second").sortable({
  13
+			connectWith: '.sortable'
  14
+		}).disableSelection();
  15
+	});
  16
+	</script>
  17
+	<style type="text/css">
  18
+		.sortable { margin: 0; padding: 0;  }
  19
+		.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; }
  20
+		#second div { background: #acc; }
  21
+	</style>
  22
+</head>
  23
+<body>
  24
+
  25
+<h1 class="ui-widget-header"><a href="http://dev.jqueryui.com/ticket/4551">#4551 - Sortable connectWith fails if item is floated</a></h1>
  26
+
  27
+<div id="first" class="sortable">
  28
+	<div>1</div>
  29
+	<div>2</div>
  30
+	<div>3</div>
  31
+	<div>4</div>
  32
+	<div>5</div>
  33
+	<div>6</div>
  34
+	<div>7</div>
  35
+	<div>8</div>
  36
+	<div>9</div>
  37
+	<div>10</div>
  38
+	<div>11</div>
  39
+	<div>12</div>
  40
+</div>
  41
+
  42
+<br style="clear:both;">
  43
+<hr />
  44
+
  45
+<div id="second" class="sortable">
  46
+	<div>12</div>
  47
+	<div>14</div>
  48
+</div>
  49
+
  50
+</body>
  51
+</html>
4  ui/ui.sortable.js
@@ -570,10 +570,6 @@ $.widget("ui.sortable", $.extend({}, $.ui.mouse, {
570 570
 		for (var i = this.items.length - 1; i >= 0; i--){
571 571
 			var item = this.items[i];
572 572
 
573  
-			//We ignore calculating positions of all connected containers when we're not over them
574  
-			if(item.instance != this.currentContainer && this.currentContainer && item.item[0] != this.currentItem[0])
575  
-				continue;
576  
-
577 573
 			var t = this.options.toleranceElement ? $(this.options.toleranceElement, item.item) : item.item;
578 574
 
579 575
 			if (!fast) {

0 notes on commit 56b0da5

Please sign in to comment.
Something went wrong with that request. Please try again.