mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
Break out event handler setup into separate method
This mirrors the keymap setup method and allows specs to reattach handlers after calling shutdown()
This commit is contained in:
@@ -5,6 +5,7 @@ describe "Window", ->
|
||||
[rootView] = []
|
||||
|
||||
beforeEach ->
|
||||
window.setUpEventHandlers()
|
||||
window.attachRootView(require.resolve('fixtures'))
|
||||
rootView = window.rootView
|
||||
|
||||
|
||||
@@ -25,7 +25,9 @@ windowAdditions =
|
||||
@syntax = new Syntax
|
||||
@setUpKeymap()
|
||||
@pasteboard = new Pasteboard
|
||||
@setUpEventHandlers()
|
||||
|
||||
setUpEventHandlers: ->
|
||||
$(window).on 'core:close', => @close()
|
||||
$(window).command 'window:close', => @close()
|
||||
$(window).command 'window:toggle-full-screen', => atom.toggleFullScreen()
|
||||
|
||||
Reference in New Issue
Block a user