X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/e6bcea32d5cbbd948da1570615a0f6afa509e467..1845953de8ccc77c57f43a9d75affa17c36e44be:/modules/documentCanvas/canvas/canvas.js diff --git a/modules/documentCanvas/canvas/canvas.js b/modules/documentCanvas/canvas/canvas.js index 144417a..f80e961 100644 --- a/modules/documentCanvas/canvas/canvas.js +++ b/modules/documentCanvas/canvas/canvas.js @@ -216,7 +216,7 @@ $.extend(Canvas.prototype, { if(params.caretTo || !textElementToLand.sameNode(this.getCursor().getPosition().element)) this._moveCaretToTextElement(textElementToLand, params.caretTo); // as method on element? if(!(textElementToLand.sameNode(currentTextElement))) - this.publisher('currentTextElementSet', element); + this.publisher('currentTextElementSet', textElementToLand); } else { document.getSelection().removeAllRanges(); } @@ -419,6 +419,9 @@ $.extend(Cursor.prototype, { anchorElement = this.canvas.getDocumentElement(selection.anchorNode), focusElement = this.canvas.getDocumentElement(selection.focusNode); + if(anchorElement instanceof documentElement.DocumentNodeElement || focusElement instanceof documentElement.DocumentNodeElement) + return {}; + if(which === 'anchor') { return { element: anchorElement,