Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#3229 closed enhancement (fixed)

DnD: There should be option for "copy-only" mode

Reported by: guest Owned by: Eugene Lazutkin
Priority: high Milestone: 0.9
Component: DnD Version: 0.9
Keywords: Cc:
Blocked By: Blocking:

Description

For now all nodes that we are trying to drag are "moveable" nodes by default, I mean that these nodes are removed from parent on drop. User has to press dojo.dnd2.multiSelectKey to do a copy of a node, there are situations when user shouldn't be able to move a node, only to copy a node. It would be good to make it possible to set container as a copy-only container. For example:

var source = new dojo.dnd2.Source(node, { copyOnly: true });

and modify onMouseMove method:

m.startDrag(this, this.getSelectedNodes(), this.copyOnly || dojo.dnd2.multiSelectKey(e));

Change History (7)

comment:1 Changed 12 years ago by Eugene Lazutkin

Milestone: 0.9beta0.9
Owner: changed from psowden to Eugene Lazutkin

comment:2 Changed 12 years ago by Eugene Lazutkin

Status: newassigned

comment:3 Changed 12 years ago by Eugene Lazutkin

Summary: DnD2: There should be option for "copy-only" modeDnD: There should be option for "copy-only" mode

Note: Being copyable is a function of a source. One way to do it is to provide a flag like suggested in the ticket. The other way is to provide a callback, so it can be queried dynamically and can be overwritten by the user. Probably that's how I'll implement it.

comment:4 Changed 12 years ago by Eugene Lazutkin

(In [9348]) Added the customization for copyOnly sources. Refs #3229.

comment:5 Changed 12 years ago by Eugene Lazutkin

During testing it turned out that onkeydown and onkeyup events are broken. Waiting for Scott to take a look at that. That is the only thing, which is required to close this ticket.

comment:6 Changed 12 years ago by Eugene Lazutkin

Resolution: fixed
Status: assignedclosed

(In [9357]) General cleanup and a typo fix. Thx, Scott. Fixes #3229.

comment:7 Changed 12 years ago by Eugene Lazutkin

(In [9371]) Cleanup. Refs #3229.

Note: See TracTickets for help on using tickets.