mirror of
https://github.com/atom/atom.git
synced 2026-02-09 06:05:11 -05:00
window-bootstrap is called when a file is opened.
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
EventEmitter = require 'event-emitter'
|
||||
Native = require 'native'
|
||||
GlobalKeymap = require 'global-keymap'
|
||||
$ = require 'jquery'
|
||||
@@ -7,11 +8,12 @@ module.exports =
|
||||
class App
|
||||
globalKeymap: null
|
||||
native: null
|
||||
windows: null
|
||||
|
||||
constructor: (@loadPath, nativeMethods)->
|
||||
@native = new Native(nativeMethods)
|
||||
@globalKeymap = new GlobalKeymap
|
||||
$(document).on 'keydown', (e) => @globalKeymap.handleKeyEvent(e)
|
||||
@native = new Native(nativeMethods)
|
||||
@windows = []
|
||||
|
||||
bindKeys: (selector, bindings) ->
|
||||
@globalKeymap.bindKeys(selector, bindings)
|
||||
@@ -25,6 +27,12 @@ class App
|
||||
quit: ->
|
||||
@native.terminate null
|
||||
|
||||
windows: ->
|
||||
# controller.jsWindow for controller in OSX.NSApp.controllers
|
||||
[]
|
||||
windowOpened: (window) ->
|
||||
@windows.push window
|
||||
@trigger "open", window
|
||||
|
||||
windowClosed: (window) ->
|
||||
index = @windows.indexOf(window)
|
||||
@windows.splice(index, 1) if index >= 0
|
||||
|
||||
_.extend(App.prototype, EventEmitter)
|
||||
|
||||
Reference in New Issue
Block a user