From: Aleksander Ɓukasz Date: Wed, 4 Jun 2014 10:44:04 +0000 (+0200) Subject: editor: handle situation when element doesn't implement getVerticallyFirstTextElement X-Git-Url: https://git.mdrn.pl/fnpeditor.git/commitdiff_plain/160268708973c7ba08f277a9d2e7cf8b9aeed1c8 editor: handle situation when element doesn't implement getVerticallyFirstTextElement --- diff --git a/src/editor/modules/documentCanvas/canvas/canvas.js b/src/editor/modules/documentCanvas/canvas/canvas.js index b234dd8..5bd5e85 100644 --- a/src/editor/modules/documentCanvas/canvas/canvas.js +++ b/src/editor/modules/documentCanvas/canvas/canvas.js @@ -349,7 +349,7 @@ $.extend(Canvas.prototype, Backbone.Events, { if(byBrowser && byBrowser.parent().sameNode(nodeToLand)) { return byBrowser; } - return e.getVerticallyFirstTextElement({considerChildren: false}); + return _.isFunction(e.getVerticallyFirstTextElement) ? e.getVerticallyFirstTextElement({considerChildren: false}) : null; }.bind(this); var _markAsCurrent = function(element) { if(element instanceof documentElement.DocumentTextElement) {