- if(_e.sameNode(params.element2))
- return true;
- });
-
- var listElement = canvas.createNodeElement({tag: 'div', klass: 'list-items' + (params.type === 'enum' ? '-enum' : '')});
- var toret;
- if(parent.is('list')) {
- var item = listElement.wrapWithNodeElement({tag: 'div', klass: 'item'});
- item.exec('toggleBullet', false);
- toret = listElement.parent();
- } else {
- toret = listElement;
- }
-
- params.element1.before(toret);
-
- elementsToWrap.forEach(function(element) {
- element.detach();
- listElement.append(element);
- });
- },
- extractItems: function(params) {
- params = _.extend({merge: true}, params);
- var list = params.element1.parent();
- if(!list.is('list') || !(list.sameNode(params.element2.parent())))
- return false;
-
- var idx1 = list.childIndex(params.element1),
- idx2 = list.childIndex(params.element2),
- precedingItems = [],
- extractedItems = [],
- succeedingItems = [],
- items = list.children(),
- listIsNested = list.parent().getWlxmlClass() === 'item',
- canvas = params.element1.canvas,
- i;
-
- if(idx1 > idx2) {
- var tmp = idx1; idx1 = idx2; idx2 = tmp;