Set font-size css property using style tag

This commit is contained in:
Corey Johnson
2013-01-30 12:11:17 -08:00
parent 9ea29b2899
commit 29ccd271de
2 changed files with 27 additions and 9 deletions

View File

@@ -683,9 +683,14 @@ class Editor extends View
@save() if @getPath()?
setFontSize: (@fontSize) ->
if fontSize?
@css('font-size', fontSize + 'px')
@redraw()
headTag = $("head")
styleTag = headTag.find("style.font-size")
if styleTag.length == 0
styleTag = $$ -> @style class: 'font-size'
headTag.append styleTag
styleTag.text(".editor {font-size: #{@fontSize}px}")
@redraw()
getFontSize: -> @fontSize