Don’t load base style sheets until config is loaded

We need to know what themes are active in order to load the correct LESS
variables.
This commit is contained in:
Nathan Sobo
2015-10-12 16:12:46 -06:00
parent d4c88cc7fd
commit f7a3e6c425
2 changed files with 6 additions and 6 deletions

View File

@@ -20,6 +20,8 @@ jasmineStyle = document.createElement('style')
jasmineStyle.textContent = atom.themes.loadStylesheet(atom.themes.resolveStylesheet('../static/jasmine'))
document.head.appendChild(jasmineStyle)
atom.themes.loadBaseStylesheets()
initialStyleElements = atom.styles.getSnapshot()
atom.themes.initialLoadComplete = true
fixturePackagesPath = path.resolve(__dirname, './fixtures/packages')
@@ -123,7 +125,7 @@ afterEach ->
# unless jasmine.getEnv().currentSpec.results().passed()
# jasmine.getEnv().specFilter = -> false
#
atom.reset()
atom.reset(stylesSnapshot: initialStyleElements)
document.getElementById('jasmine-content').innerHTML = '' unless window.debugContent

View File

@@ -185,9 +185,6 @@ class AtomEnvironment extends Model
})
@themes.workspace = @workspace
@themes.loadBaseStylesheets()
@initialStyleElements = @styles.getSnapshot()
@keymaps.subscribeToFileReadFailure()
@keymaps.loadBundledKeymaps()
@@ -239,7 +236,7 @@ class AtomEnvironment extends Model
when 'atom://.atom/init-script'
@workspace.open(@getUserInitScriptPath())
reset: ->
reset: (params) ->
@deserializers.clear()
@registerDefaultDeserializers()
@@ -252,7 +249,7 @@ class AtomEnvironment extends Model
@commands.clear()
registerDefaultCommands(this)
@styles.restoreSnapshot(@initialStyleElements)
@styles.restoreSnapshot(params?.stylesSnapshot ? [])
@menu.clear()
@@ -594,6 +591,7 @@ class AtomEnvironment extends Model
console.warn error.message if error?
@config.load()
@themes.loadBaseStylesheets()
@setBodyPlatformClass()
document.head.appendChild(@styles.buildStylesElement())