mirror of
https://github.com/atom/atom.git
synced 2026-02-17 18:11:29 -05:00
Use current window by default in atom.confirmSync
Closes atom/tree-view#7
This commit is contained in:
@@ -224,12 +224,11 @@ class Pane extends View
|
||||
# Public: Prompt the user to save the given item.
|
||||
promptToSaveItem: (item) ->
|
||||
uri = item.getUri()
|
||||
currentWindow = require('remote').getCurrentWindow()
|
||||
chosen = atom.confirmSync(
|
||||
"'#{item.getTitle?() ? item.getUri()}' has changes, do you want to save them?"
|
||||
"Your changes will be lost if you close this item without saving."
|
||||
["Save", "Cancel", "Don't Save"]
|
||||
currentWindow
|
||||
atom.getCurrentWindow()
|
||||
)
|
||||
switch chosen
|
||||
when 0 then @saveItem(item, -> true)
|
||||
|
||||
Reference in New Issue
Block a user