mirror of
https://github.com/atom/atom.git
synced 2026-02-10 06:35:00 -05:00
Don't load base style sheets in AtomEnvironment
As it will happen again right after package activation. Signed-off-by: Nathan Sobo <nathan@github.com>
This commit is contained in:
committed by
Nathan Sobo
parent
47391110e8
commit
fce10242dc
@@ -233,7 +233,6 @@ class AtomEnvironment extends Model
|
||||
|
||||
@config.load()
|
||||
|
||||
@themes.loadBaseStylesheets()
|
||||
@initialStyleElements = @styles.getSnapshot()
|
||||
@themes.initialLoadComplete = true if onlyLoadBaseStyleSheets
|
||||
@setBodyPlatformClass()
|
||||
|
||||
@@ -126,10 +126,10 @@ class ThemeManager
|
||||
#
|
||||
# Returns a {Disposable} on which `.dispose()` can be called to remove the
|
||||
# required stylesheet.
|
||||
requireStylesheet: (stylesheetPath) ->
|
||||
requireStylesheet: (stylesheetPath, priority) ->
|
||||
if fullPath = @resolveStylesheet(stylesheetPath)
|
||||
content = @loadStylesheet(fullPath)
|
||||
@applyStylesheet(fullPath, content)
|
||||
@applyStylesheet(fullPath, content, priority)
|
||||
else
|
||||
throw new Error("Could not find a file at path '#{stylesheetPath}'")
|
||||
|
||||
@@ -175,9 +175,7 @@ class ThemeManager
|
||||
@reloadBaseStylesheets()
|
||||
|
||||
reloadBaseStylesheets: ->
|
||||
@requireStylesheet('../static/atom')
|
||||
if nativeStylesheetPath = fs.resolveOnLoadPath(process.platform, ['css', 'less'])
|
||||
@requireStylesheet(nativeStylesheetPath)
|
||||
@requireStylesheet('../static/atom', -2)
|
||||
|
||||
stylesheetElementForId: (id) ->
|
||||
escapedId = id.replace(/\\/g, '\\\\')
|
||||
@@ -231,8 +229,8 @@ class ThemeManager
|
||||
removeStylesheet: (stylesheetPath) ->
|
||||
@styleSheetDisposablesBySourcePath[stylesheetPath]?.dispose()
|
||||
|
||||
applyStylesheet: (path, text) ->
|
||||
@styleSheetDisposablesBySourcePath[path] = @styleManager.addStyleSheet(text, sourcePath: path)
|
||||
applyStylesheet: (path, text, priority) ->
|
||||
@styleSheetDisposablesBySourcePath[path] = @styleManager.addStyleSheet(text, {priority, sourcePath: path})
|
||||
|
||||
activateThemes: ->
|
||||
new Promise (resolve) =>
|
||||
|
||||
@@ -51,7 +51,7 @@ class WorkspaceElement extends HTMLElement
|
||||
line-height: #{@config.get('editor.lineHeight')};
|
||||
}
|
||||
"""
|
||||
@styles.addStyleSheet(styleSheetSource, sourcePath: 'global-text-editor-styles')
|
||||
@styles.addStyleSheet(styleSheetSource, {sourcePath: 'global-text-editor-styles', priority: -1})
|
||||
@views.performDocumentPoll()
|
||||
|
||||
initialize: (@model, {@views, @workspace, @project, @config, @styles}) ->
|
||||
|
||||
Reference in New Issue
Block a user