From: Aleksander Ɓukasz Date: Tue, 16 Jul 2013 08:51:07 +0000 (+0200) Subject: Fix X-Git-Url: https://git.mdrn.pl/fnpeditor.git/commitdiff_plain/9a9e6d2723f56145d45790667212a4019fd5776b?ds=sidebyside;hp=67387c5b199cba829f5f7563ff93020328cbe0ef Fix --- diff --git a/modules/documentCanvas/canvas/canvas.test3.js b/modules/documentCanvas/canvas/canvas.test3.js index 0b71ee0..43c9083 100644 --- a/modules/documentCanvas/canvas/canvas.test3.js +++ b/modules/documentCanvas/canvas/canvas.test3.js @@ -304,7 +304,7 @@ describe('Canvas', function() { children = c.doc().children(); expect(children.length).to.equal(1); - expect(children[0].sameNode(appended)); + expect(children[0].sameNode(appended)).to.be.true; }); it('can put new TextElement at the end', function() { @@ -313,7 +313,7 @@ describe('Canvas', function() { children = c.doc().children(); expect(children.length).to.equal(1); - expect(children[0].sameNode(appended)); + expect(children[0].sameNode(appended)).to.be.true; expect(children[0].getText()).to.equal('Alice'); }); @@ -323,7 +323,7 @@ describe('Canvas', function() { added = div.after({tag: 'header', klass: 'some.class'}), children = c.doc().children(); expect(children.length).to.equal(2); - expect(children[1].sameNode(added)); + expect(children[1].sameNode(added)).to.be.true; }); it('can put new Nodeelement before another element', function() { @@ -332,7 +332,7 @@ describe('Canvas', function() { added = div.before({tag: 'header', klass: 'some.class'}), children = c.doc().children(); expect(children.length).to.equal(2); - expect(children[0].sameNode(added)); + expect(children[0].sameNode(added)).to.be.true; }); it('can put new DocumentNodeElement after DocumentTextElement', function() { diff --git a/modules/documentCanvas/canvas/documentElement.js b/modules/documentCanvas/canvas/documentElement.js index aa3fd9b..0309136 100644 --- a/modules/documentCanvas/canvas/documentElement.js +++ b/modules/documentCanvas/canvas/documentElement.js @@ -143,14 +143,14 @@ DocumentNodeElement.prototype = new DocumentElement(); $.extend(DocumentNodeElement.prototype, { append: function(params) { - manipulate(this, params, 'append'); + return manipulate(this, params, 'append'); }, before: function(params) { - manipulate(this, params, 'before'); + return manipulate(this, params, 'before'); }, after: function(params) { - manipulate(this, params, 'after'); + return manipulate(this, params, 'after'); }, children: function() { var toret = [];