X-Git-Url: https://jasonwoof.com/gitweb/?p=peach-html5-editor.git;a=blobdiff_plain;f=editor.coffee;h=0d9d495ccaf68f729ca471a2ef670f754416ab9f;hp=3d3336d3b9d77208f8226af67bb84828039a4d6d;hb=60bdb823e686628c9831bb16f7f1b27abd4a6610;hpb=7f075c8f4e23d2c49dbfadf8819ca61630466119 diff --git a/editor.coffee b/editor.coffee index 3d3336d..0d9d495 100644 --- a/editor.coffee +++ b/editor.coffee @@ -892,12 +892,10 @@ class PeachHTML5Editor @matt null move_cursor: (cursor) -> @cursor = cursor - # replace cursor element, to reset blink animation - if @cursor_visible - @cursor_el.parentNode.removeChild @cursor_el - @cursor_el = domify @outer_idoc, div: id: 'cursor' - @overlay.appendChild @cursor_el - @cursor_visible = true + unless @cursor_visible + @cursor_el = domify @outer_idoc, div: id: 'cursor' + @overlay.appendChild @cursor_el + @cursor_visible = true @cursor_el.style.left = "#{cursor.x + overlay_padding - 1}px" if cursor.h < 5 height = 12