From b48a35fc14c121eae1bdd69c85f5b26a31bd75b9 Mon Sep 17 00:00:00 2001 From: Ben Ogle Date: Tue, 10 Sep 2013 15:20:15 -0700 Subject: [PATCH] Reload the stylesheet when it is applied >1x --- src/window.coffee | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/window.coffee b/src/window.coffee index 7f7bc8bee..7a2201f0d 100644 --- a/src/window.coffee +++ b/src/window.coffee @@ -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 "" else