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) {
-extension.documentTransformations.push({
- name: 'createList',
+extension.documentMethods = {
+ areItemsOfSameList: function(params) {
+ return params.node1.parent().sameNode(params.node2.parent()) && params.node2.parent().is('list');
+ }
+}
+
+
+
+extension.document.transformations.createList = {
impl: function(params) {
var parent = params.node1.parent(),
parentContents = parent.contents(),
nodeIndexes = [params.node1.getIndex(), params.node2.getIndex()].sort(),
nodesToWrap = [],
impl: function(params) {
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'}}),
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(),
var parent = this.args.nodel1.parent();
return parent.is('list') && parent.sameNode(this.args.node2.parent());
}
var parent = this.args.nodel1.parent();
return parent.is('list') && parent.sameNode(this.args.node2.parent());
}