1.8rc2 cssPosition in sortable

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

Before 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.
  1. <div class="AdminSidebar" style="float:left">
  2.         <div class="AdminWidget">
  3.                 <ul><li><img src="move.png" class="moveWidget" /></li></ul>
  4.                 <div class="WidgetContent">....</div>
  5.         </div>
  6.         <div class="AdminWidget">
  7.                 <ul><li><img src="move.png" class="moveWidget" /></li></ul>
  8.                 <div class="WidgetContent">....</div>

  9.         </div>
  10. </div>
  11. <div class="AdminSidebar" style="float:left;">
  12.         ......
  13. </div>

  1. $(".AdminSidebar").sortable({
            connectWith: '.AdminSidebar',
            handle: '.moveWidget',
            stop: function(event, ui) {
                    var sidebars = $('div.AdminSidebar');
                    //do stuff

  2.         }
Any comments on this?