mirror of
https://github.com/atom/atom.git
synced 2026-04-06 03:02:13 -04:00
Revert to default font when setFontFamily is set to null/undefined
This commit is contained in:
committed by
Corey Johnson & Kevin Sawicki
parent
1b98bf706e
commit
b878be27a0
@@ -1155,14 +1155,17 @@ class Editor extends View
|
||||
#
|
||||
# fontFamily - A {String} identifying the CSS `font-family`,
|
||||
setFontFamily: (fontFamily) ->
|
||||
return if fontFamily == undefined
|
||||
headTag = $("head")
|
||||
styleTag = headTag.find("style.editor-font-family")
|
||||
if styleTag.length == 0
|
||||
styleTag = $$ -> @style class: 'editor-font-family'
|
||||
headTag.append styleTag
|
||||
|
||||
styleTag.text(".editor {font-family: #{fontFamily}}")
|
||||
if fontFamily?
|
||||
if styleTag.length == 0
|
||||
styleTag = $$ -> @style class: 'editor-font-family'
|
||||
headTag.append styleTag
|
||||
styleTag.text(".editor {font-family: #{fontFamily}}")
|
||||
else
|
||||
styleTag.remove()
|
||||
|
||||
@redraw()
|
||||
|
||||
# Public: Gets the font family for the editor.
|
||||
|
||||
Reference in New Issue
Block a user