#4 new
timothegard

Dropping on scrolled DIVs

Reported by timothegard | May 10th, 2008 @ 01:04 AM

When dragging between two sortables: when the target sortable is scrolled, the element-in-motion "jumps" when it reaches the drop-boundary (an amount equal to the scroll offset).

Attached is an example HTML file. To test: the left side is the source, the right is the target. Scroll the target box down and then try to drag an item into the scrolled DIV.

Thank you

Comments and changes to this ticket

  • timothegard

    timothegard May 19th, 2008 @ 11:40 PM

    Mr. Fuchs,

    With some extended research, it appears that this is a bug in the prototype library and NOT Scriptaculous. Very sorry to bother you.

    I've been able to patch my Prototype code successfully. Thought I'd post as FYI.

    What a fantastic toolkit! It has made our lives so much easier!

    Thank you,

    tdg

    cumulativeOffset: function(element) {

    var valueT = 0, valueL = 0;

    do {

    valueT += element.offsetTop || 0;

    valueL += element.offsetLeft || 0;

    if (element.offsetParent == document.body)

    if (Element.getStyle(element, 'position') == 'absolute') break;

    valueT -= element.scrollTop || 0;

    valueL -= element.scrollLeft || 0;

    element = element.offsetParent;

    } while (element);

    return Element._returnOffset(valueL, valueT);

    },

    ////////////WAS

    //cumulativeOffset: function(element) {

    // var valueT = 0, valueL = 0;

    // do {

    // valueT += element.offsetTop || 0;

    // valueL += element.offsetLeft || 0;

    // element = element.offsetParent;

    // } while (element);

    // return Element._returnOffset(valueL, valueT);

    // },

    ////////////WAS

    Element.Methods.cumulativeOffset = function(element) {

    var valueT = 0, valueL = 0;

    do {

    valueT += element.offsetTop || 0;

    valueL += element.offsetLeft || 0;

    if (element.offsetParent == document.body)

    if (Element.getStyle(element, 'position') == 'absolute') break;

    valueT -= element.scrollTop || 0;

    valueL -= element.scrollLeft || 0;

    element = element.offsetParent;

    } while (element);

    return Element._returnOffset(valueL, valueT);

    };

    }

    /////WAS

    // Element.Methods.cumulativeOffset = function(element) {

    // var valueT = 0, valueL = 0;

    // do {

    // valueT += element.offsetTop || 0;

    // valueL += element.offsetLeft || 0;

    // if (element.offsetParent == document.body)

    // if (Element.getStyle(element, 'position') == 'absolute') break;

    //

    // element = element.offsetParent;

    // } while (element);

    //

    // return Element._returnOffset(valueL, valueT);

    // };

    //}

    /////WAS

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

script.aculo.us is an open-source JavaScript framework for visual effects and interface behaviours.
<br/><b>Source available from github</b>
The Git repository resides at:
<a href="http://github.com/madrobby/scriptaculous">http://github.com/madrobby/scriptaculous</a>
<br/>Check out the current development trunk with:
<code>git clone git://github.com/madrobby/scriptaculous.git</code>
<br/>As <b>script.aculo.us 1.xx is feature-frozen</b>, this development trunk is for <b>bugfixes only</b>.
<br/>New development should happen only for
<b>script.aculo.us 2</b>.
<br/><b>Creating a bug report</b>
When creating a bug report, be sure to include as much relevant information as possible. Post a an example that shows off the problem. Preferably, <b>alter the unit tests</b> and show through either changed or added tests how the expected behavior is not occuring.

People watching this ticket

Attachments

Pages