From: Jason Woofenden Date: Tue, 8 Mar 2016 16:31:48 +0000 (-0500) Subject: improve scrolling a bit X-Git-Url: https://jasonwoof.com/gitweb/?p=peach-html5-editor.git;a=commitdiff_plain;h=6c22b1995a894c76fd54349f978a36fd09960bc9 improve scrolling a bit --- diff --git a/editor.coffee b/editor.coffee index 370f2a1..c3f35be 100644 --- a/editor.coffee +++ b/editor.coffee @@ -564,7 +564,6 @@ class PeachHTML5Editor 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 @@ -723,6 +722,8 @@ class PeachHTML5Editor @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