Move document mutation to startEditorWindow

This commit is contained in:
Nathan Sobo
2015-09-30 13:37:24 -06:00
parent 2737e05561
commit ee270db7ac
4 changed files with 9 additions and 12 deletions

View File

@@ -247,14 +247,6 @@ class Atom extends Model
#
# Call after this instance has been assigned to the `atom` global.
initialize: ->
@setBodyPlatformClass()
{devMode, safeMode, resourcePath} = @getLoadSettings()
configDirPath = @getConfigDirPath()
document.head.appendChild(new StylesElement)
if grammarOverridesByPath = @state.grammars?.grammarOverridesByPath
@grammars.grammarOverridesByPath = grammarOverridesByPath
@@ -577,6 +569,9 @@ class Atom extends Model
@loadConfig()
@themes.loadBaseStylesheets()
@setBodyPlatformClass()
document.head.appendChild(new StylesElement)
@packages.loadPackages()
@deserializeEditorWindow()

View File

@@ -191,7 +191,10 @@ class MenuManager
# Get an {Array} of {String} classes for the given element.
classesForElement: (element) ->
element?.classList.toString().split(' ') ? []
if classList = element?.classList
Array::slice.apply(classList)
else
[]
sortPackagesMenu: ->
packagesMenu = _.find @template, ({label}) -> MenuHelpers.normalizeLabel(label) is 'Packages'

View File

@@ -132,7 +132,6 @@ class Package
@activationPromise ?=
new Promise (resolve, reject) =>
@resolveActivationPromise = resolve
@rejectActivationPromise = reject
@measure 'activateTime', =>
try
@activateResources()
@@ -370,10 +369,8 @@ class Package
console.error "Error serializing package '#{@name}'", e.stack
deactivate: ->
@rejectActivationPromise?()
@activationPromise = null
@resolveActivationPromise = null
@rejectActivationPromise = null
@activationCommandSubscriptions?.dispose()
@deactivateResources()
@deactivateConfig()