From e2d727f8387984fd103fe6a034df15df7ebceb4c Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Thu, 26 Sep 2013 09:00:39 -0700 Subject: [PATCH] Move Syntax global to Atom class --- src/atom.coffee | 5 ++++- src/window.coffee | 10 +++------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/atom.coffee b/src/atom.coffee index a840628e5..fcda9fe66 100644 --- a/src/atom.coffee +++ b/src/atom.coffee @@ -16,6 +16,7 @@ PackageManager = require './package-manager' Pasteboard = require './pasteboard' Project = require './project' RootView = require './root-view' +Syntax = require './syntax' Subscriber = require './subscriber' ThemeManager = require './theme-manager' ContextMenuManager = require './context-menu-manager' @@ -24,12 +25,14 @@ ContextMenuManager = require './context-menu-manager' module.exports = class Atom extends Subscriber constructor: -> + @rootViewParentSelector = 'body' @packages = new PackageManager() @themes = new ThemeManager() @contextMenu = new ContextMenuManager(@getLoadSettings().devMode) @config = new Config() @pasteboard = new Pasteboard() @keymap = new KeyMap() + @syntax = deserialize(@getWindowState('syntax')) ? new Syntax() getCurrentWindow: -> remote.getCurrentWindow() @@ -72,7 +75,7 @@ class Atom extends Subscriber @rootView = new RootView() state.set('rootView', @rootView.getState()) - $(rootViewParentSelector).append(rootView) + $(@rootViewParentSelector).append(rootView) @subscribe @project, 'path-changed', -> projectPath = project.getPath() diff --git a/src/window.coffee b/src/window.coffee index 96458bede..52d242363 100644 --- a/src/window.coffee +++ b/src/window.coffee @@ -26,14 +26,10 @@ displayWindow = -> # This method is called in any window needing a general environment, including specs window.setUpEnvironment = (windowMode) -> atom.windowMode = windowMode + #TODO remove once all packages use the atom global window.resourcePath = atom.getLoadSettings().resourcePath - - Syntax = require './syntax' - - window.rootViewParentSelector = 'body' - #TODO remove once all packages use the atom globa window.config = atom.config - window.syntax = deserialize(atom.getWindowState('syntax')) ? new Syntax + window.syntax = atom.syntax window.pasteboard = atom.pasteboard window.keymap = atom.keymap @@ -105,7 +101,7 @@ window.onDrop = (e) -> window.deserializeEditorWindow = -> atom.deserializeEditorWindow() - #TODO remove once all packages use the atom globa + #TODO remove once all packages use the atom global window.project = atom.project window.rootView = atom.rootView