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

34 lines
815 B
JavaScript
Raw Normal View History

/**
* VisualEditor content editable LeafNode class.
*
* @copyright 2011-2012 VisualEditor Team and others; see AUTHORS.txt
* @license The MIT License (MIT); see LICENSE.txt
*/
2012-02-10 16:57:02 +00:00
/**
* ContentEditable node that can not have any children.
*
2012-02-10 16:57:02 +00:00
* @class
* @abstract
* @constructor
* @extends {ve.LeafNode}
* @extends {ve.ce.Node}
* @param {String} type Symbolic name of node type
* @param model {ve.dm.LeafNode} Model to observe
2012-02-10 16:57:02 +00:00
* @param {jQuery} [$element] Element to use as a container
*/
ve.ce.LeafNode = function ( type, model, $element ) {
2012-02-10 16:57:02 +00:00
// Inheritance
ve.LeafNode.call( this );
ve.ce.Node.call( this, type, model, $element );
2012-02-10 16:57:02 +00:00
// DOM Changes
if ( model.isWrapped() ) {
this.$.addClass( 've-ce-leafNode' );
}
2012-02-10 22:19:12 +00:00
};
2012-02-10 16:57:02 +00:00
/* Inheritance */
ve.extendClass( ve.ce.LeafNode, ve.LeafNode, ve.ce.Node );