JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
improve scrolling a bit
authorJason Woofenden <jason@jasonwoof.com>
Tue, 8 Mar 2016 16:31:48 +0000 (11:31 -0500)
committerJason Woofenden <jason@jasonwoof.com>
Tue, 8 Mar 2016 16:31:48 +0000 (11:31 -0500)
editor.coffee

index 370f2a1..c3f35be 100644 (file)
@@ -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