From: Jason Woofenden Date: Tue, 8 Mar 2016 17:30:45 +0000 (-0500) Subject: fix typo/crash in chrome for empty text nodes X-Git-Url: https://jasonwoof.com/gitweb/?p=peach-html5-editor.git;a=commitdiff_plain;h=01d1661cb1c3d11720ddbf1337b0b51d83152fdc fix typo/crash in chrome for empty text nodes --- diff --git a/editor.coffee b/editor.coffee index ceffb9a..45e5f36 100644 --- a/editor.coffee +++ b/editor.coffee @@ -98,7 +98,7 @@ window.cursor_to_xyh = cursor_to_xyh = (n, i) -> range = document.createRange() if n.text.length is 0 ret = text_range_bounds n.el, 0, 0 - if i is n.text.length + else if i is n.text.length ret = text_range_bounds n.el, i - 1, i if ret? ret.x += ret.w