Results 1 to 2 of 2

Thread: can i keep an offset after setting it once?

  1. #1

    Default can i keep an offset after setting it once?

    I am overwriting the onDrag function
    Code:
    onDrag : function(evt) {
         var xy = evt.xy;
         var x = xy[0];
         var y = xy[1];
         if (x < endProjX) { //entering an area where i need to change the draggable look
    		//... code sets variables and changes look of the dragging element
    		if (!sortedProj) {
    			dragDom.style.position='absolute';
    			var newY = y-15;
    			dragDom.style.top = newY+'px';
    			Ext.dd.DragDropMgr.refreshCache({group:true});
    			sortedProj = true;
    		} 
         }
    }
    So when the dragging element passes a certain area, it changes from 305x90 to 305x20. I want the mouse to stay on the object, so I push down the draggable to the mouse. This makes it so the element is still on the mouse, instead of having the 70 pixel gap.

    If sortedProj is always true this works perfect everywhere except Firefox Mac because it flickers before it repositions it. So I figure if I only need to reposition it once, no user would notice that one flicker, but as soon as sortedProj is true with the above code, the gap appears again (if i started dragging below the 20 pixel mark).

  2. #2
    Sencha User
    Join Date
    Jan 2008
    Posts
    240

    Default

    So what's your question? You can add a property to an object if you want and store something to check later.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •