From: Aleksander Ɓukasz Date: Mon, 24 Jun 2013 10:39:14 +0000 (+0200) Subject: canvas api: fixing list adding X-Git-Url: https://git.mdrn.pl/fnpeditor.git/commitdiff_plain/b381ca66b7a9766aa4f408f6d0add75d486ef3d5 canvas api: fixing list adding --- diff --git a/modules/documentCanvas/canvas.js b/modules/documentCanvas/canvas.js index eb0fd0b..848dc48 100644 --- a/modules/documentCanvas/canvas.js +++ b/modules/documentCanvas/canvas.js @@ -147,14 +147,14 @@ Canvas.prototype.createList = function(options) { else { $node = $(node); } - $node.attr('wlxml-class', 'list.item'); + $node.attr('wlxml-class', 'item'); nodesToWrap.push($node); } if(node.isSameNode(element2.get(0))) return; }); - var list = this._createNode('div', 'list'); + var list = this._createNode('div', 'list-items'); element1.before(list); nodesToWrap.forEach(function(node) { diff --git a/modules/documentCanvas/tests/canvas.test.js b/modules/documentCanvas/tests/canvas.test.js index 57ad625..7515309 100644 --- a/modules/documentCanvas/tests/canvas.test.js +++ b/modules/documentCanvas/tests/canvas.test.js @@ -118,8 +118,8 @@ define([ ); }); - test('list', function() { - var c = new canvas.Canvas('
Alice
has
a cat
'); + test('create list from existing nodes', function() { + var c = new canvas.Canvas('
Alice
has
a cat
some text
'); var div1 = c.getNode({tag:'div'})[0]; var div2 = c.getNode({tag:'div'})[1]; @@ -127,11 +127,12 @@ define([ assert.xmlEqual(c.toXML(), '\
\ -
\ -
Alice
\ -
has
\ -
a cat
\ +
\ +
Alice
\ +
has
\ +
a cat
\
\ +
some text
\
'); });