Measure DOM in EditorComponent when a stylesheet is updated

This commit is contained in:
Nathan Sobo
2014-07-28 15:43:17 -06:00
parent eebbb99fc8
commit bd77a02207
3 changed files with 13 additions and 4 deletions

View File

@@ -176,7 +176,7 @@ EditorComponent = React.createClass
@listenForDOMEvents()
@listenForCommands()
@subscribe atom.themes, 'stylesheet-added stylsheet-removed', @onStylesheetsChanged
@subscribe atom.themes, 'stylesheet-added stylesheet-removed stylesheet-updated', @onStylesheetsChanged
@subscribe scrollbarStyle.changes, @refreshScrollbars
if @visible = @isVisible()

View File

@@ -359,8 +359,10 @@ class WorkspaceView extends View
atom.themes.applyStylesheet('global-editor-styles', '.editor {}')
styleNode = atom.themes.stylesheetElementForId('global-editor-styles')[0]
editorRule = styleNode.sheet.cssRules[0]
{sheet} = styleNode
editorRule = sheet.cssRules[0]
editorRule.style[property] = value
atom.themes.emit 'stylesheet-updated', sheet
atom.themes.emit 'stylesheets-changed'
# Deprecated