X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/c29d2f9290ba801c3f89e8034512f2cfc2655f8d..25dbd250996753d1fbd63201fe75a87949c106d6:/src/editor/modules/documentCanvas/canvas/genericElement.js?ds=sidebyside diff --git a/src/editor/modules/documentCanvas/canvas/genericElement.js b/src/editor/modules/documentCanvas/canvas/genericElement.js index 878e140..4dfbe59 100644 --- a/src/editor/modules/documentCanvas/canvas/genericElement.js +++ b/src/editor/modules/documentCanvas/canvas/genericElement.js @@ -80,13 +80,18 @@ $.extend(generic, { return toret; }, - getVerticallyFirstTextElement: function() { + getVerticallyFirstTextElement: function(params) { var toret; + + params = _.extend({ + considerChildren: true + }, params); + this.children().some(function(child) { if(child instanceof documentElement.DocumentTextElement) { toret = child; return true; // break - } else { + } else if(params.considerChildren) { toret = child.getVerticallyFirstTextElement(); if(toret) { return true; // break