if @options.editor_id?
@outer_iframe.setAttribute 'id', @options.editor_id
@outer_iframe.onload = =>
- console.log 'outer onload'
@outer_idoc = @outer_iframe.contentDocument
icss = domify @outer_idoc, style: children: [
domify @outer_idoc, text: css
@in_el.value = dom_to_html @tree
@in_el.onchange = =>
@load_html @in_el.value
+ @iframe.style.height = "0"
+ @iframe.style.height = "#{@idoc.body.scrollHeight}px"
kill_cursor: -> # remove it, forget where it was
if @cursor_visible
@cursor_el.parentNode.removeChild @cursor_el