PDA

View Full Version : BasicDialog proxy drag



jarrednicholls
10 Nov 2006, 11:42 AM
Jack,

With 0.33 RC1, proxy drag isn't working. It could be because the proxy is now in Display mode rather than Visibility mode. I'm not sure why you did that.

Thanks.

-Jarred

jarrednicholls
10 Nov 2006, 11:47 AM
Confirmed. Remove the call "this.proxy.enableDisplayMode('block');" and everything is just fine.

jack.slocum
10 Nov 2006, 7:45 PM
Display mode is required to keep it from causing scrollbars when it is hidden.

I changed these two functions, does this work for you?



startMove : function(){
if(this.proxyDrag){
this.proxy.show();
}
if(this.constraintoviewport != false){
this.dd.resetConstraints();
this.viewSize = [YAHOO.util.Dom.getViewportWidth(),YAHOO.util.Dom.getViewportHeight()];
this.dd.setXConstraint(this.xy[0], this.viewSize[0]-this.xy[0]-this.el.getWidth()-this.shadowOffset);
this.dd.setYConstraint(this.xy[1], this.viewSize[1]-this.xy[1]-this.el.getHeight()-this.shadowOffset);
}
},

endMove : function(){
YAHOO.util.DDProxy.prototype.endDrag.apply(this.dd, arguments);
this.refreshSize();
this.adjustShadow();
if(this.proxyDrag){
this.proxy.hide();
}
this.fireEvent('move', this, this.xy[0], this.xy[1])
}

jarrednicholls
11 Nov 2006, 7:25 AM
Yeah that's just as good, thank you.

I didn't know about that bug. I've used it in IE6 and FF 1.5 and haven't experienced scroll bars popping up at all, but I understand.

You're getting another donation :-)

jack.slocum
11 Nov 2006, 4:12 PM
Thanks. :)

The scrollbars only appear if the body element scrolls - if you are using BorderLayout (which I think you are) and kill body scroll then you would never get them.

jarrednicholls
12 Nov 2006, 1:16 AM
Not sure, but it's broken still. This time, it's not the dragging itself, but after a drag, when you hide the dialog and it has an animateTarget, the proxy doesn't animate back to the target, it just disappears. Then a reopen of the dialog and the proxy isn't animating, it's basically "gone". I thought it was because the proxy was being show after a setBounds was being called, but that doesn't seem to matter if you don't drag the dialog at all before hiding the dialog. Weird.

Thanks.

-Jarred

P.S. I think it might have to do with the way the YUI DDProxy handles the beginning and end of a drag using a proxy element. It might not like the idea that the element is in display mode or something when the drag ends. I'm not really in the mood to dig through Yahoo! code :-( hehe

jack.slocum
12 Nov 2006, 4:56 AM
You were along the right lines. DDProxy sets visibility hidden on the proxy and we are using display. I just undid their setting.


endMove : function(){
if(!this.proxyDrag){
YAHOO.util.DD.prototype.endDrag.apply(this.dd, arguments);
}else{
YAHOO.util.DDProxy.prototype.endDrag.apply(this.dd, arguments);
this.proxy.setStyle('visibility', 'visible');
this.proxy.hide();
}
this.refreshSize();
this.adjustShadow();
this.fireEvent('move', this, this.xy[0], this.xy[1])
}

jarrednicholls
12 Nov 2006, 8:57 AM
Thanks so much for looking into this. I feel like I'm being a pain in the ass :-)

-Jarred

jack.slocum
12 Nov 2006, 6:58 PM
People who have donated are never a pain in the ass. :)