mirror of
https://github.com/atom/atom.git
synced 2026-01-24 14:28:14 -05:00
making close work
This commit is contained in:
@@ -12,8 +12,8 @@ class Browser extends Document
|
||||
$ "<iframe src='#{@path}' style='width:100%;height:100%'></iframe>"
|
||||
|
||||
constructor: (@path) ->
|
||||
@html.html @iframe()
|
||||
@html.html @iframe().bind 'load', (e) =>
|
||||
window.setTitle e.target.contentWindow.document.title
|
||||
@show()
|
||||
|
||||
atom.trigger 'browser:load', this
|
||||
super()
|
||||
|
||||
@@ -26,5 +26,6 @@ class Document extends Pane
|
||||
@constructor is Document.handler path
|
||||
|
||||
close: ->
|
||||
window.close()
|
||||
|
||||
save: ->
|
||||
|
||||
@@ -95,15 +95,15 @@ class Editor extends Document
|
||||
else
|
||||
"An untitled file has changes."
|
||||
|
||||
canceled = atom.native.alert "Do you want to save your changes?",
|
||||
close = atom.native.alert "Do you want to save your changes?",
|
||||
detailedMessage,
|
||||
"Save": =>
|
||||
# if save modal fails/cancels, consider it cancelled
|
||||
not @save()
|
||||
"Cancel": => true
|
||||
"Don't Save": => false
|
||||
"Save": => @save()
|
||||
"Cancel": => false
|
||||
"Don't Save": => true
|
||||
|
||||
return if canceled
|
||||
return if not close
|
||||
|
||||
super
|
||||
|
||||
save: ->
|
||||
return @saveAs() if not @path
|
||||
|
||||
Reference in New Issue
Block a user