mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-15 02:23:58 +00:00
42 lines
877 B
JavaScript
42 lines
877 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();
|
|
};
|
|
|
|
/* Inheritance */
|
|
|
|
ve.extendClass( ve.es.LeafNode, ve.LeafNode );
|
|
ve.extendClass( ve.es.LeafNode, ve.es.Node );
|