diff --git a/core/modules/widgets/droppable.js b/core/modules/widgets/droppable.js index f2e0ee7b7..dabb4c259 100644 --- a/core/modules/widgets/droppable.js +++ b/core/modules/widgets/droppable.js @@ -128,7 +128,9 @@ DroppableWidget.prototype.handleDropEvent = function(event) { DroppableWidget.prototype.performActions = function(title,event) { if(this.droppableActions) { - this.invokeActionString(this.droppableActions,this,event,{actionTiddler: title}); + var modifierKey = event.ctrlKey && ! event.shiftKey ? "ctrl" : event.shiftKey && !event.ctrlKey ? "shift" : + event.ctrlKey && event.shiftKey ? "ctrl-shift" : "normal" ; + this.invokeActionString(this.droppableActions,this,event,{actionTiddler: title, modifier: modifierKey}); } }; diff --git a/editions/tw5.com/tiddlers/variables/modifier Variable.tid b/editions/tw5.com/tiddlers/variables/modifier Variable.tid new file mode 100644 index 000000000..44c4c2077 --- /dev/null +++ b/editions/tw5.com/tiddlers/variables/modifier Variable.tid @@ -0,0 +1,14 @@ +tags: Variables [[Core Variables]] +title: modifier Variable +type: text/vnd.tiddlywiki + +Within the ''action'' string of the DroppableWidget, the <<.def modifier>> [[variable|Variables]] contains the modifier key(s) held during the drag-process. +The possible keys are ''ctrl'', ''shift'' or both ''ctrl'' and ''shift'' + +The variable contains a string that identifies the keys: + +|Modifier Key |Variable Content |h +|ctrl |ctrl | +|shift |shift | +|ctrl+shift |ctrl-shift | +|no modifier (normal drag) |normal | diff --git a/editions/tw5.com/tiddlers/widgets/DroppableWidget.tid b/editions/tw5.com/tiddlers/widgets/DroppableWidget.tid index 19f1f9fc8..10c58e4c0 100644 --- a/editions/tw5.com/tiddlers/widgets/DroppableWidget.tid +++ b/editions/tw5.com/tiddlers/widgets/DroppableWidget.tid @@ -31,7 +31,10 @@ See DragAndDropMechanism for an overview. |class |Optional CSS classes to assign to the draggable element. The class `tc-droppable` is added automatically, and the class `tc-dragover` is applied while an item is being dragged over the droppable element | |tag |Optional tag to override the default of a "div" element when the widget is rendered in block mode, or a "span" element when it is rendered in inline mode | -Within the action string, the [[actionTiddler Variable]] contains the title of the item being dropped. +Within the action string, there are two Variables generated by the DroppableWidget: + +* The [[actionTiddler Variable]] contains the title of the item being dropped +* The [[modifier Variable]] contains the Modifier Key held while dragging (can be normal, ctrl, shift or ctrl-shift) If multiple items are dropped then the actions are performed repeatedly, once for each dropped item.