Use current window by default in atom.confirmSync

Closes atom/tree-view#7
This commit is contained in:
Kevin Sawicki
2013-09-27 12:07:36 -07:00
parent f1d0711198
commit a433f5eb61
2 changed files with 16 additions and 14 deletions

View File

@@ -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)