mediawiki-extensions-Visual.../modules/ve2/ce/ve.ce.Document.js
Trevor Parscal 89b2260bfc Revert "Support for basic text insertion - typing"
This reverts commit 21056ff5ec.

Change-Id: I86bb28d868b2c931f4b6e18ba5023a8a75b40231
2012-06-08 15:54:05 -07:00

30 lines
602 B
JavaScript

/**
* ContentEditable document.
*
* @class
* @extends {ve.Document}
* @constructor
* @param model {ve.dm.Document} Model to observe
*/
ve.ce.Document = function( model ) {
// Inheritance
ve.Document.call( this, new ve.ce.DocumentNode( model.getDocumentNode() ) );
// Properties
this.model = model;
};
/* Methods */
ve.ce.Document.prototype.getNodeFromOffset = function( offset ) {
var node = this.documentNode.getNodeFromOffset( offset );
if ( !node.canHaveChildren() ) {
node = node.getParent();
}
return node;
};
/* Inheritance */
ve.extendClass( ve.ce.Document, ve.Document );