mirror of
https://github.com/atom/atom.git
synced 2026-01-23 22:08:08 -05:00
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:
@@ -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
|
||||
|
||||
|
||||
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user