forked from jquery/jquery-ui
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Sortable: Introduces option containmentElasticity to allow for items …
…to move a few pixels outside their containment when dragging; By no means a perfect fix but a possible first stab. Tries fixing #5620 - Sortable along y-axis with parent containment fails to put large item at the bottom of list when dragging
- Loading branch information
marcusf
committed
May 24, 2010
1 parent
956f48a
commit dc5c4b3
Showing
2 changed files
with
64 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<title>Sortable Visual Test : Sortable ticket #5620</title> | ||
<link rel="stylesheet" href="../visual.css" type="text/css" /> | ||
<link rel="stylesheet" href="../../../themes/base/jquery.ui.all.css" type="text/css"> | ||
<script type="text/javascript" src="../../../jquery-1.4.2.js"></script> | ||
<script type="text/javascript" src="../../../ui/jquery.ui.core.js"></script> | ||
<script type="text/javascript" src="../../../ui/jquery.ui.widget.js"></script> | ||
<script type="text/javascript" src="../../../ui/jquery.ui.mouse.js"></script> | ||
<script type="text/javascript" src="../../../ui/jquery.ui.draggable.js"></script> | ||
<script type="text/javascript" src="../../../ui/jquery.ui.droppable.js"></script> | ||
<script type="text/javascript" src="../../../ui/jquery.ui.sortable.js"></script> | ||
|
||
<style> | ||
#list div { | ||
width: 100px; | ||
font-size: 12px; | ||
} | ||
</style> | ||
|
||
<script type="text/javascript"> | ||
jQuery(document).ready(function() { $("#list").sortable({axis: 'y', containment: 'parent', containmentElasticity: true }); }); | ||
</script> | ||
</head> | ||
<body> | ||
<div id="list"> | ||
<div>Element 1</div> | ||
<div>Element 2</div> | ||
<div>Element 3</div> | ||
<div>Element 4</div> | ||
<div>Very long text Very long text Very long text Very long text Very long text Very long text Very long text Very long text Very long text Very long text Very long text Very long text Very long text Very long text Very long textVery long text</div> | ||
<div>Element 5</div> | ||
</div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dc5c4b3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sortable, and all other interaction plugins, are about to undergo a complete rewrite which will remove the majority of their options. At this point we cannot accept a commit that will add another option which will not be included in the rewrite. If you have ideas for how this would ideally work, we'd love to capture that information on the planning wiki (http://wiki.jqueryui.com/Sortable) so we can account for it during the new development.
dc5c4b3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, basically, how I want it to work is that when I drag an entry to the bottom, it ends up there, regardless of its size relative its peers. I could add that, but it really feels like a bug, and I've supplied a reduced test case and all. This was just my stab at providing a workaround.