X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/c29d2f9290ba801c3f89e8034512f2cfc2655f8d..1a51f254c2c899b068ecfca66fd472ae79fadda3:/src/editor/modules/documentCanvas/canvas/genericElement.js 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