mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-09-20 15:37:46 +03:00
Meta-w closes spec windows again.
This adds a 'core:close' event to meta-w in the default bindings, and modifies window to listen for it.
This commit is contained in:
parent
b71fa308a3
commit
ca2527f4b8
@ -13,7 +13,7 @@ describe "Window", ->
|
|||||||
describe ".close()", ->
|
describe ".close()", ->
|
||||||
it "is triggered by the 'close' event", ->
|
it "is triggered by the 'close' event", ->
|
||||||
spyOn window, 'close'
|
spyOn window, 'close'
|
||||||
$(window).trigger 'close'
|
$(window).trigger 'core:close'
|
||||||
expect(window.close).toHaveBeenCalled()
|
expect(window.close).toHaveBeenCalled()
|
||||||
|
|
||||||
describe ".reload()", ->
|
describe ".reload()", ->
|
||||||
|
@ -18,6 +18,7 @@ class Keymap
|
|||||||
'meta-n': 'new-window'
|
'meta-n': 'new-window'
|
||||||
'meta-,': 'open-user-configuration'
|
'meta-,': 'open-user-configuration'
|
||||||
'meta-o': 'open'
|
'meta-o': 'open'
|
||||||
|
'meta-w': 'core:close'
|
||||||
|
|
||||||
$(document).on 'new-window', => atom.newWindow()
|
$(document).on 'new-window', => atom.newWindow()
|
||||||
$(document).on 'open-user-configuration', => atom.open(atom.configFilePath)
|
$(document).on 'open-user-configuration', => atom.open(atom.configFilePath)
|
||||||
|
@ -24,6 +24,7 @@ windowAdditions =
|
|||||||
TextMateBundle.loadAll()
|
TextMateBundle.loadAll()
|
||||||
TextMateTheme.loadAll()
|
TextMateTheme.loadAll()
|
||||||
@setUpKeymap()
|
@setUpKeymap()
|
||||||
|
$(window).on 'core:close', => @close()
|
||||||
|
|
||||||
# This method is intended only to be run when starting a normal application
|
# This method is intended only to be run when starting a normal application
|
||||||
# Note: RootView assigns itself on window on initialization so that
|
# Note: RootView assigns itself on window on initialization so that
|
||||||
@ -34,7 +35,6 @@ windowAdditions =
|
|||||||
else
|
else
|
||||||
new RootView(pathToOpen)
|
new RootView(pathToOpen)
|
||||||
|
|
||||||
$(window).on 'close', => @close()
|
|
||||||
$(@rootViewParentSelector).append(@rootView)
|
$(@rootViewParentSelector).append(@rootView)
|
||||||
$(window).focus()
|
$(window).focus()
|
||||||
$(window).on 'beforeunload', =>
|
$(window).on 'beforeunload', =>
|
||||||
|
Loading…
Reference in New Issue
Block a user