Skip to content

Commit 8f8a2ac

Browse files
committed
chore: add optional file to delete override to FILE_DELETE command
1 parent b6fe002 commit 8f8a2ac

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/document/DocumentCommandHandlers.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1916,9 +1916,13 @@ define(function (require, exports, module) {
19161916
return Strings.MOVE_TO_TRASH;
19171917
}
19181918

1919-
/** Delete file command handler **/
1920-
function handleFileDelete() {
1921-
const entry = ProjectManager.getSelectedItem();
1919+
/** Delete file command handler
1920+
*
1921+
* @param {{file: File}} [commandData] Optional bag of arguments:
1922+
* file - File to delete; assumes the current document if not specified.
1923+
* **/
1924+
function handleFileDelete(commandData={}) {
1925+
const entry = commandData.file || ProjectManager.getSelectedItem();
19221926
const canMoveToTrash = Phoenix.app.canMoveToTrash(entry.fullPath);
19231927
Dialogs.showModalDialog(
19241928
DefaultDialogs.DIALOG_ID_EXT_DELETED,

0 commit comments

Comments
 (0)