From dd6094842e6bc5835c7eeefbec89a24c209e077f Mon Sep 17 00:00:00 2001 From: Inez Korczynski Date: Wed, 2 May 2012 14:18:02 -0700 Subject: [PATCH] Created a test file for ve.ce.TextNode and fixed some minor issues. Change-Id: Ifbf6b7ba2a27eedf6d5d4f6cb06b98c38eb52c5b --- modules/ve2/ce/nodes/ve.ce.TextNode.js | 2 +- modules/ve2/dm/ve.dm.BranchNode.js | 2 +- tests/ve2/index.html | 4 +++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/modules/ve2/ce/nodes/ve.ce.TextNode.js b/modules/ve2/ce/nodes/ve.ce.TextNode.js index 82e1db3e26..c606fd2285 100644 --- a/modules/ve2/ce/nodes/ve.ce.TextNode.js +++ b/modules/ve2/ce/nodes/ve.ce.TextNode.js @@ -209,7 +209,7 @@ ve.ce.TextNode.prototype.getHtml = function( range ) { } else { range = { 'start': 0, 'end': undefined }; } - var data = this.doc.getDataFromNode( this ), + var data = this.model.getDocument().getDataFromNode( this.model ), render = ve.ce.TextNode.renderAnnotation, htmlChars = ve.ce.TextNode.htmlCharacters; var out = '', diff --git a/modules/ve2/dm/ve.dm.BranchNode.js b/modules/ve2/dm/ve.dm.BranchNode.js index 1fe56c7db6..f8b47e4eb1 100644 --- a/modules/ve2/dm/ve.dm.BranchNode.js +++ b/modules/ve2/dm/ve.dm.BranchNode.js @@ -166,7 +166,7 @@ ve.dm.BranchNode.prototype.splice = function( index, howmany ) { * @param {ve.Node} node Node to get offset of * @returns {Integer} Offset of node or -1 of node was not found */ -ve.dm.DocumentFragment.prototype.getOffsetFromNode = function( node ) { +ve.dm.BranchNode.prototype.getOffsetFromNode = function( node ) { if ( node === this ) { return 0; } diff --git a/tests/ve2/index.html b/tests/ve2/index.html index 645869fd83..e185516176 100644 --- a/tests/ve2/index.html +++ b/tests/ve2/index.html @@ -90,12 +90,14 @@ + + - +