X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/1dcfdcafd9fd0ff3af5dc39619a3a953f4377a11..12255fb81ee2d3b63e238a595e4813520650cd01:/modules/documentCanvas/canvas/canvas.js?ds=sidebyside diff --git a/modules/documentCanvas/canvas/canvas.js b/modules/documentCanvas/canvas/canvas.js index 1bd2f15..c4bfc09 100644 --- a/modules/documentCanvas/canvas/canvas.js +++ b/modules/documentCanvas/canvas/canvas.js @@ -116,7 +116,7 @@ $.extend(Canvas.prototype, { return wrapperElement; }, getDocumentElement: function(from) { - if(from instanceof HTMLElement) { + if(from instanceof HTMLElement || from instanceof Text) { return documentElement.wrap(from, this); } }, @@ -175,6 +175,7 @@ $.extend(Canvas.prototype.list, { }); }, extractItems: function(params) { + params = _.extend({merge: true}, params); var list = params.element1.parent(); if(!list.is('list') || !(list.sameNode(params.element2.parent()))) return false; @@ -239,6 +240,10 @@ $.extend(Canvas.prototype.list, { reference.after(toAdd); } + if(!params.merge && listIsNested) { + return this.extractItems({element1: extractedItems[0], element2: extractedItems[extractedItems.length-1]}); + } + return true; }, areItemsOfTheSameList: function(params) { var e1 = params.element1,