mirror of
https://github.com/atom/atom.git
synced 2026-01-22 21:38:10 -05:00
Reload the stylesheet when it is applied >1x
This commit is contained in:
@@ -178,7 +178,11 @@ window.removeStylesheet = (stylesheetPath) ->
|
||||
window.stylesheetElementForId(fullPath).remove()
|
||||
|
||||
window.applyStylesheet = (id, text, ttype = 'bundled') ->
|
||||
unless window.stylesheetElementForId(id).length
|
||||
styleElement = window.stylesheetElementForId(id)
|
||||
if styleElement.length
|
||||
console.log 'replacing style in', styleElement
|
||||
styleElement.text(text)
|
||||
else
|
||||
if $("head style.#{ttype}").length
|
||||
$("head style.#{ttype}:last").after "<style class='#{ttype}' id='#{id}'>#{text}</style>"
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user