JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
fix typo/crash in chrome for empty text nodes
[peach-html5-editor.git] / editor.coffee
index ceffb9a..45e5f36 100644 (file)
@@ -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