mediawiki-extensions-Visual.../modules/ve/ce/ve.es.LeafNode.js
Alexandre Emsenhuber bfa0a28968 svn:eol-style native
2012-02-10 16:57:02 +00:00

42 lines
836 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 );