itemIndex: function(listItem) {
var toret = -1;
this.contents('.item').some(function(item, index) {
itemIndex: function(listItem) {
var toret = -1;
this.contents('.item').some(function(item, index) {
var parent = params.node1.parent(),
parentContents = parent.contents(),
nodeIndexes = [params.node1.getIndex(), params.node2.getIndex()].sort(),
nodesToWrap = [],
var parent = params.node1.parent(),
parentContents = parent.contents(),
nodeIndexes = [params.node1.getIndex(), params.node2.getIndex()].sort(),
nodesToWrap = [],
- listNode = params.node1.document.createDocumentNode({tagName: 'div', attrs: {'class': 'list.items'}}),
+ listNode = params.node1.document.createDocumentNode({tagName: 'div', attrs: {'class': 'list'}}),
node, i;
for(i = nodeIndexes[0]; i <= nodeIndexes[1]; i++) {
node = parentContents[i];
if(node.nodeType === Node.TEXT_NODE) {
node, i;
for(i = nodeIndexes[0]; i <= nodeIndexes[1]; i++) {
node = parentContents[i];
if(node.nodeType === Node.TEXT_NODE) {
var toInsert;
if(parent.is('list') && parent.object.itemIndex(nodesToWrap[0]) > 0) { // object api
// var prevItem = parent.object.getItem(parent.object.itemIndex(nodesToWrap[0])-1); // object api
var toInsert;
if(parent.is('list') && parent.object.itemIndex(nodesToWrap[0]) > 0) { // object api
// var prevItem = parent.object.getItem(parent.object.itemIndex(nodesToWrap[0])-1); // object api
impl: function(params) {
params = _.extend({}, {merge: true}, params);
var list = params.item1.parent(),
impl: function(params) {
params = _.extend({}, {merge: true}, params);
var list = params.item1.parent(),
- items = list.contents(), // lub list.object.items()
- listIsNested = list.parent().is('item'),
- i;
+ items = list.contents(),
+ listIsNested = list.parent().is('item');
+
if(succeedingItems.length === 0) {
var reference_orig = reference;
extractedItems.forEach(function(item) {
if(succeedingItems.length === 0) {
var reference_orig = reference;
extractedItems.forEach(function(item) {
reference = item;
});
var secondList = params.item1.document.createDocumentNode({tagName: 'div', attrs: {'class':'list'}}),
reference = item;
});
var secondList = params.item1.document.createDocumentNode({tagName: 'div', attrs: {'class':'list'}}),
- var parent = this.args.nodel1.parent();
- return parent.is('list') && parent.sameNode(this.args.node2.parent());
+ var parent = this.args[0].nodel1.parent();
+ return parent.is('list') && parent.sameNode(this.args[0].node2.parent());