mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-25 06:46:26 +00:00
46 lines
930 B
JavaScript
46 lines
930 B
JavaScript
/**
|
|
* 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();
|
|
};
|
|
|
|
ve.es.LeafNode.prototype.getDOMText = function() {
|
|
return ve.ce.getDOMText( this.$[0] );
|
|
};
|
|
|
|
/* Inheritance */
|
|
|
|
ve.extendClass( ve.es.LeafNode, ve.LeafNode );
|
|
ve.extendClass( ve.es.LeafNode, ve.es.Node );
|