mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-09-22 00:19:24 +03:00
Use atom.confirm
when for confirmation when deleting a file in the TreeView
This commit is contained in:
parent
95b1ebdd8c
commit
d8ea46ee5b
@ -209,15 +209,13 @@ class TreeView extends View
|
||||
return unless entry
|
||||
|
||||
entryType = if entry instanceof DirectoryView then "directory" else "file"
|
||||
message = "Are you sure you would like to delete the selected #{entryType}?"
|
||||
detailedMessage = "You are deleting #{entry.getPath()}"
|
||||
buttons = [
|
||||
["Move to Trash", => Native.moveToTrash(entry.getPath())]
|
||||
["Cancel", => ] # Do Nothing
|
||||
["Delete", => fs.remove(entry.getPath())]
|
||||
]
|
||||
|
||||
Native.alert message, detailedMessage, buttons
|
||||
atom.confirm(
|
||||
"Are you sure you would like to delete the selected #{entryType}?",
|
||||
"You are deleting #{entry.getPath()}",
|
||||
"Move to Trash", (=> Native.moveToTrash(entry.getPath())),
|
||||
"Cancel", null
|
||||
"Delete", (=> fs.remove(entry.getPath()))
|
||||
)
|
||||
|
||||
add: ->
|
||||
selectedPath = @selectedEntry().getPath()
|
||||
|
Loading…
Reference in New Issue
Block a user