mediawiki-extensions-Visual.../modules/ve/ce/ve.es.LeafNode.js

46 lines
930 B
JavaScript
Raw Normal View History

2012-02-10 16:57:02 +00:00
/**
* Creates an ve.es.LeafNode object.
*
* @class
* @abstract
* @constructor
* @extends {ve.LeafNode}
* @extends {ve.es.Node}
* @param model {ve.ModelNode} Model to observe
* @param {jQuery} [$element] Element to use as a container
*/
ve.es.LeafNode = function( model, $element ) {
// Inheritance
ve.LeafNode.call( this );
ve.es.Node.call( this, model, $element );
this.$.data('view', this);
this.$.addClass('ce-leafNode');
// Properties
this.contentView = new ve.es.Content( this.$, model );
// Events
this.contentView.on( 'update', this.emitUpdate );
};
/* Methods */
/**
* Render content.
*
* @method
*/
ve.es.LeafNode.prototype.renderContent = function() {
this.contentView.render();
};
2012-02-10 22:19:12 +00:00
ve.es.LeafNode.prototype.getDOMText = function() {
return ve.ce.getDOMText( this.$[0] );
};
2012-02-10 16:57:02 +00:00
/* Inheritance */
ve.extendClass( ve.es.LeafNode, ve.LeafNode );
ve.extendClass( ve.es.LeafNode, ve.es.Node );