Opened 13 years ago

Closed 13 years ago

Last modified 12 years ago

#1468 closed defect (fixed)

FloatingPane events being squelched after drag

Reported by: guest Owned by: dylan
Priority: high Milestone:
Component: DnD Version: 0.3
Keywords: Cc:
Blocked By: Blocking:

Description

Hi there,

It seems there's a problem with floatingpane events being squelched after the pane is moved. Here's a URL you can use to demonstrate the problem:

http://vortex3.reurbanise.geek.nz/@@/vortexanalyzer/dojo_test.html

The dojo is a subversion checkout of a couple of months ago. I put some debugging in HtmlDragAndDrop?.js and it seems that squelchOnClick is being called every time you click on one of the controls on the pane.

I'll try to patch it for now, but if someone could look at this ASAP, that'd be great. Hell, I'll even chip in some money to get it fixed if necessary :-)

Cheers, Andrew.

Change History (6)

comment:1 Changed 13 years ago by guest

comment:2 Changed 13 years ago by guest

Priority: highesthigh
severity: blockermajor

The problem seems to be with this call:

disconnect after a short delay to prevent "Null argument to unrollAdvice()" warning dojo.lang.setTimeout(function() {

dojo.event.disconnect(this.domNode, "onclick", this, "squelchOnClick");

},50);

I'm guessing that the use of "this" inside the function is interpreted as "window" in the scope of the timeout. I patched it for my app with:

Record the current object in globals so we can retrieve it in the timeout. globalsdragObject? = this;

disconnect after a short delay to prevent "Null argument to unrollAdvice()" warning dojo.lang.setTimeout(function() {

dojo.event.disconnect(globalsdragObject?.domNode, "onclick", globalsdragObject?, "squelchOnClick");

},50);

This works for me but isn't ideal for Dojo unless there's some similar global storage area defined by dojo.

Cheers, Andrew.

comment:3 Changed 13 years ago by dylan

Milestone: 0.5
Owner: changed from psowden to dylan

try out dojo.lang.hitch, if scope is the issue here.

comment:4 Changed 13 years ago by shawn

ran into this problem myself, looked at the workaround submitted by andrew, and he suggested using a global storage area for that variable, but you only need to declare it within the function - I added this to my code to make forms work after being dragged (basically reassigning "this" to a temporary variable:

dojo.lang.extend(dojo.dnd.HtmlDragObject?,{

squelchOnClick: function(e){

squelch this onClick() event because it's the result of a drag (it's not a real click) dojo.event.browser.stopEvent(e); var temp = this;

disconnect after a short delay to prevent "Null argument to unrollAdvice()" warning dojo.lang.setTimeout(function() {

dojo.event.disconnect(temp.domNode, "onclick", temp, "squelchOnClick");

},50);

}

});

comment:5 Changed 13 years ago by bill

Milestone: 0.50.4.1
Resolution: fixed
Status: newclosed

This has been fixed already a few weeks ago, on 10/26. Will be in 0.4.1. You can test it on the latest SVN code.

comment:6 Changed 12 years ago by (none)

Milestone: 0.4.1

Milestone 0.4.1 deleted

Note: See TracTickets for help on using tickets.