+var getElementForElementRootNode = function(node, mirrors, canvasContainer) {
+ if(canvasContainer) {
+ var candidates = [node.getData('canvasElement')].concat(node.getData('mirrorElements')),
+ toret;
+ candidates.some(function(c) {
+ // @@
+ if(c.dom.parents().index(canvasContainer.dom) !== -1) {
+ toret = c;
+ return true;
+ }
+ });
+ return toret;
+ }
+ return node.getData(mirrors ? 'mirrorElements' : 'canvasElement');