mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-27 12:04:04 +01:00
list: make onDragStart optional
This commit is contained in:
@@ -134,17 +134,23 @@ function asObjectTreeOptions<TInput, T, TFilterData>(options?: IAsyncDataTreeOpt
|
||||
getDragURI(node) {
|
||||
return options.dnd!.getDragURI(node.element as T);
|
||||
},
|
||||
getDragLabel: options.dnd!.getDragLabel && ((nodes) => {
|
||||
return options.dnd!.getDragLabel!(nodes.map(node => node.element as T));
|
||||
}),
|
||||
getDragLabel(nodes) {
|
||||
if (options.dnd!.getDragLabel) {
|
||||
return options.dnd!.getDragLabel!(nodes.map(node => node.element as T));
|
||||
}
|
||||
|
||||
return undefined;
|
||||
},
|
||||
onDragStart(data, originalEvent) {
|
||||
return options.dnd!.onDragStart(data, originalEvent);
|
||||
if (options.dnd!.onDragStart) {
|
||||
options.dnd!.onDragStart!(data, originalEvent);
|
||||
}
|
||||
},
|
||||
onDragOver(data, targetNode, targetIndex, originalEvent) {
|
||||
return options.dnd!.onDragOver(data, targetNode && targetNode.element as T, targetIndex, originalEvent);
|
||||
},
|
||||
drop(data, targetNode, targetIndex, originalEvent) {
|
||||
return options.dnd!.drop(data, targetNode && targetNode.element as T, targetIndex, originalEvent);
|
||||
options.dnd!.drop(data, targetNode && targetNode.element as T, targetIndex, originalEvent);
|
||||
}
|
||||
},
|
||||
multipleSelectionController: options.multipleSelectionController && {
|
||||
|
||||
Reference in New Issue
Block a user