Clear font style in afterEach so it doesn't cause test pollution

This commit is contained in:
Nathan Sobo
2013-02-09 16:47:00 -07:00
parent 13db9169e9
commit 97988eb62e
2 changed files with 10 additions and 4 deletions

View File

@@ -742,9 +742,9 @@ class Editor extends View
setFontFamily: (fontFamily) ->
return if fontFamily == undefined
headTag = $("head")
styleTag = headTag.find("style.font-family")
styleTag = headTag.find("style.editor-font-family")
if styleTag.length == 0
styleTag = $$ -> @style class: 'font-family'
styleTag = $$ -> @style class: 'editor-font-family'
headTag.append styleTag
styleTag.text(".editor {font-family: #{fontFamily}}")
@@ -752,6 +752,9 @@ class Editor extends View
getFontFamily: -> @css("font-family")
clearFontFamily: ->
$('head style.editor-font-family').remove()
redraw: ->
return unless @hasParent()
return unless @attached