Write spec for TextEditorElement when autoHeight changes

This commit is contained in:
Antonio Scandurra
2016-06-30 15:48:00 +02:00
parent b46ae1e681
commit 7efb407d8a
2 changed files with 27 additions and 3 deletions

View File

@@ -38,7 +38,8 @@ class TextEditorElement extends HTMLElement
@setAttribute('tabindex', -1)
initializeContent: (attributes) ->
@resetAutoHeight()
unless @getModel().getAutoHeight()
@style.height = "100%"
if @config.get('editor.useShadowDOM')
@useShadowDOM = true
@@ -193,8 +194,11 @@ class TextEditorElement extends HTMLElement
@removeAttribute("mini")
resetAutoHeight: ->
unless @getModel().getAutoHeight()
@style.height = "100%"
@views.updateDocument =>
if @getModel().getAutoHeight()
@style.height = ""
else
@style.height = "100%"
addEncodingAttribute: ->
@dataset.encoding = @model.getEncoding()