1.8rc2 cssPosition in sortable
I had a problem with sortable, in that, when there was a scrollbar and I had scrolled down the page the box that I was trying to drag around would popup to the top of the page, sometime the css property top of the moving box was a minus number.
I finally managed to get it fixed, I moved line 145 above 144 in this file
http://code.google.com/p/jquery-ui/source/browse/tags/1.8rc2/ui/jquery.ui.sortable.jsBefore the change I was getting this.offset.parent.top as a very hight number(about the same pageY as the helper object in _mouseStart() ) if the page had a scrollbar and I had scrolled down the page. So _generatePosition().top would return a low number even though your current position was at the bottom of a long page.
This is my code, simplified. All of the moving boxes[AdminWidget] are position:static.
- <div class="AdminSidebar" style="float:left">
- <div class="AdminWidget">
- <ul><li><img src="move.png" class="moveWidget" /></li></ul>
- <div class="WidgetContent">....</div>
- </div>
- <div class="AdminWidget">
- <ul><li><img src="move.png" class="moveWidget" /></li></ul>
- <div class="WidgetContent">....</div>
- </div>
- </div>
- <div class="AdminSidebar" style="float:left;">
- ......
- </div>
- $(".AdminSidebar").sortable({
connectWith: '.AdminSidebar',
handle: '.moveWidget',
stop: function(event, ui) {
var sidebars = $('div.AdminSidebar');
//do stuff
- }
});
Any comments on this?
Regards
ingig