fix: 让 filetree 右键删除复用批量选择
This commit is contained in:
@@ -3834,6 +3834,13 @@ const SIDEBAR_TREE_JS: &str = r##"
|
||||
void copyTreeContextValue(documentId || detail.assetId || detail.rowId || '', 'copy-id');
|
||||
return;
|
||||
}
|
||||
if (action === 'delete-trash' && detail.contextKind === 'filetree') {
|
||||
var selectedFileTreeRows = selectedSidebarFileTreeRows();
|
||||
if (selectedFileTreeRows.length > 1) {
|
||||
void deleteSelectedSidebarFileTreeRows(trigger || document.body);
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (action === 'delete-trash' && isAsset) {
|
||||
if (!window.confirm('确定要将“' + title + '”删除到垃圾桶吗?')) return;
|
||||
recordFileTreeAction('delete-trash', detail);
|
||||
@@ -10127,6 +10134,8 @@ mod tests {
|
||||
fn sidebar_filetree_delete_keys_support_mixed_doc_and_asset_selection() {
|
||||
assert!(SIDEBAR_TREE_JS.contains("function deleteSelectedSidebarFileTreeRows"));
|
||||
assert!(SIDEBAR_TREE_JS.contains("event.key === 'Delete' || event.key === 'Backspace'"));
|
||||
assert!(SIDEBAR_TREE_JS.contains("selectedFileTreeRows.length > 1"));
|
||||
assert!(SIDEBAR_TREE_JS.contains("deleteSelectedSidebarFileTreeRows(trigger || document.body)"));
|
||||
assert!(SIDEBAR_TREE_JS.contains(
|
||||
"currentSourceKind() === 'local_folder' && fileTreeRowKind(row) === 'asset'"
|
||||
));
|
||||
|
||||
Reference in New Issue
Block a user