Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#7277 closed enhancement (fixed)

avoid code repetition in dojo.dnd.Source

Reported by: chucky Owned by: Eugene Lazutkin
Priority: high Milestone: 1.2
Component: DnD Version: 1.1.1
Keywords: Cc: tomas.mikula@…
Blocked By: Blocking:

Description

Function onDropInternal in dojo.dnd.Source contains the following code structure

if(this.creator){
	if(copy){
		// block 1
	}else{
		// block 2
	}
}else{
	if(copy){
		// block 3
	}else{
		// block 4
	}
}

where block 2 and block 4 are identical. If there isn't some reason to keep it as is, I would suggest to restructure that part like this

if(copy){
	if(this.creator){
		// block 1
	}else{
		// block 3
	}
}else{
	// block 2 (= block 4)
}

Change History (2)

comment:1 Changed 11 years ago by Eugene Lazutkin

Resolution: fixed
Status: newclosed

(In [14591]) dnd: removing some duplicated code. Thx, chucky! Fixes #7277. !strict

comment:2 Changed 11 years ago by dylan

Milestone: tbd1.2
Note: See TracTickets for help on using tickets.