Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#2223 closed defect (invalid)

Dialog close on onBackgroundClick event if closeNode is set

Reported by: florynth Owned by: bill
Priority: high Milestone:
Component: Widgets Version: 0.4.1
Keywords: Cc:
Blocked By: Blocking:

Description

The Dialog widget is not suppose to close by BcakgroundClick? if a closeNode have been specified but it does so.

I did modify the code to make this work (as a suggestion because I don't know enough about DOJO to be sure it's the best place to put it) see the comment in CAPITAL to know where

onBackgroundClick: function(){

summary Callback on background click. Clicking anywhere on the background will close the dialog, but only if the dialog doesn't have an explicit close button, and only if the dialog doesn't have a blockDuration. if(this.closeNode){ return; } THAT'S WHAT I ADD if(this.lifetime - this.timeRemaining >= this.blockDuration){ return; } this.hide();

}

Change History (5)

comment:1 Changed 13 years ago by bill

(In [6928]) Fix comment. References #2223

comment:2 Changed 13 years ago by bill

Resolution: wontfix
Status: newclosed

The behavior has been intentionally changed so that clicking the background closes the dialog if you specify closeOnBackgroundClick=true. The comment in that function was wrong, so I updated it.

comment:3 Changed 13 years ago by mpoiriert@…

Resolution: wontfix
Status: closedreopened

I've check the setCloseControl method and there's a property set (this.closeOnBackgroundClick = false;) who's done, but still a backgroundClick close the dialog, I've try to set it at execution time to false myself and same problem. But if I set it by default to false (in the dojo.declare...) it does work. (I've paste the official setCloseContral without any modification)

setCloseControl: function(/*String|DomNode?*/ node) {

summary Specify which node is the close button for this dialog. If no close node is specified then clicking anywhere on the screen will close the dialog. this.closeNode = dojo.byId(node); dojo.event.connect(this.closeNode, "onclick", this, "hide"); this.closeOnBackgroundClick = false;

}

There's probably a initialisation who's done before (with a dojo.event.connect) who's not taking out... I don't know wich object is connected to this event but it should probably taking out (probably the best way) or replace the

if(this.closeNode){ return; }

by

if(!this.closeOnBackgroundClick){ return; }

in the code that I've put in the first message.

comment:4 Changed 13 years ago by bill

Resolution: invalid
Status: reopenedclosed

You are looking at some old code. The current setCloseControl does no such thing.

		setCloseControl: function(/*String|DomNode*/ node) {
			// summary
			//	Specify which node is the close button for this dialog.
			//	If no close node is specified then clicking anywhere on the screen will close the dialog.
			this.closeNode = dojo.byId(node);
			dojo.event.connect(this.closeNode, "onclick", this, "hide");
		},

However, the comment is wrong, so I will update that.

comment:5 Changed 13 years ago by bill

(In [6930]) Fix comment. References #2223.

Note: See TracTickets for help on using tickets.