Only create EditorComponent once per editor

This commit is contained in:
Nathan Sobo
2017-03-14 22:45:32 -06:00
committed by Antonio Scandurra
parent ebad2e6605
commit f00941f299

View File

@@ -3547,9 +3547,12 @@ class TextEditor extends Model
# Get the Element for the editor.
getElement: ->
TextEditorComponent ?= require('./text-editor-component')
new TextEditorComponent({model: this})
@component.element
if @component?
@component.element
else
TextEditorComponent ?= require('./text-editor-component')
new TextEditorComponent({model: this})
@component.element
# Essential: Retrieves the greyed out placeholder of a mini editor.
#