Emit 'stylesheet-changed' from atom.themes

Whenever stylesheets are applied or removed.
This commit is contained in:
Nathan Sobo
2014-03-19 14:43:31 -06:00
parent 24943dd526
commit 2d26382510
2 changed files with 11 additions and 0 deletions

View File

@@ -191,6 +191,7 @@ class ThemeManager
removeStylesheet: (stylesheetPath) ->
fullPath = @resolveStylesheet(stylesheetPath) ? stylesheetPath
@stylesheetElementForId(@stringToId(fullPath)).remove()
@emit 'stylesheets-changed'
applyStylesheet: (path, text, ttype = 'bundled', htmlElement=$('html')) ->
styleElement = @stylesheetElementForId(@stringToId(path), htmlElement)
@@ -201,3 +202,4 @@ class ThemeManager
htmlElement.find("head style.#{ttype}:last").after "<style class='#{ttype}' id='#{@stringToId(path)}'>#{text}</style>"
else
htmlElement.find("head").append "<style class='#{ttype}' id='#{@stringToId(path)}'>#{text}</style>"
@emit 'stylesheets-changed'