window.close() calls resource.close()

this is similar to resource.open(). the return value
of resource.close() determines whether window should
stop or bubble it up to app.close()
This commit is contained in:
Chris Wanstrath
2011-11-26 03:24:38 -08:00
parent 9e92877da3
commit 25041a49da
2 changed files with 6 additions and 6 deletions

View File

@@ -5,6 +5,7 @@ app:
window:
'cmd-shift-I': (window) -> window.showConsole()
'cmd-r': (window) -> window.reload()
'cmd-w': (window) -> window.close()
'cmd-o': (window) -> window.open()
'cmd-O': (window) -> window.open window.prompt "Open URL:"
'cmd-s': (window) -> window.save()
@@ -15,7 +16,6 @@ window:
s.src = 'http://erkie.github.com/asteroids.min.js'
editor:
'cmd-w': 'close'
'cmd-shift-s': 'saveAs'
'cmd-c': 'copy'
'cmd-x': 'cut'

View File

@@ -22,6 +22,7 @@ windowAdditions =
throw "I DON'T KNOW ABOUT #{@url}" if not success
shutdown: ->
$atomController.close
showConsole: ->
$atomController.webView.inspector.showConsole true
@@ -30,20 +31,19 @@ windowAdditions =
$atomController.window.title = title
reload: ->
@close()
@shutdown()
OSX.NSApp.createController @url
open: (url) ->
url = atom.native.openPanel() unless url
(@resource.open url) or atom.app.open url
close: ->
@resource.close() or @shutdown()
save: ->
@resource.save()
close: (url) ->
@shutdown()
$atomController.close
handleKeyEvent: ->
atom.keybinder.handleEvent arguments...