mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-12-01 17:36:35 +00:00
39 lines
822 B
JavaScript
39 lines
822 B
JavaScript
|
/**
|
||
|
* Creates an ve.dm.ListItemNode object.
|
||
|
*
|
||
|
* @class
|
||
|
* @constructor
|
||
|
* @extends {ve.dm.LeafNode}
|
||
|
* @param {Object} element Document data element of this node
|
||
|
* @param {Integer} length Length of document data element
|
||
|
*/
|
||
|
ve.dm.ListItemNode = function( element, contents ) {
|
||
|
// Inheritance
|
||
|
ve.dm.BranchNode.call( this, 'listItem', element, contents );
|
||
|
};
|
||
|
|
||
|
/* Methods */
|
||
|
|
||
|
/**
|
||
|
* Creates a list item view for this model.
|
||
|
*
|
||
|
* @method
|
||
|
* @returns {ve.es.ListItemNode}
|
||
|
*/
|
||
|
ve.dm.ListItemNode.prototype.createView = function() {
|
||
|
return new ve.es.ListItemNode( this );
|
||
|
};
|
||
|
|
||
|
/* Registration */
|
||
|
|
||
|
ve.dm.DocumentNode.nodeModels.listItem = ve.dm.ListItemNode;
|
||
|
|
||
|
ve.dm.DocumentNode.nodeRules.listItem = {
|
||
|
'parents': ['list'],
|
||
|
'children': null
|
||
|
};
|
||
|
|
||
|
/* Inheritance */
|
||
|
|
||
|
ve.extendClass( ve.dm.ListItemNode, ve.dm.BranchNode );
|