mediawiki-extensions-Visual.../modules/ve2/ce/nodes/ve.ce.ListItemNode.js
Trevor Parscal 9887dbd96f Split Broke DefinitionListNode out of ListNode and DefinitionListItemNode out of ListItemNode
* Makes it simpler in the linear model because we don't have to use style: "item" for regular list items and style: "definition" for definition lists
* Enforces correct nesting through existing node rules systems
* Updates tests accordingly

Change-Id: I64d80af938e325f1961226505bdc386bb35ccdda
2012-05-04 11:56:32 -07:00

36 lines
644 B
JavaScript

/**
* ContentEditable node for a list item.
*
* @class
* @constructor
* @extends {ve.ce.BranchNode}
* @param model {ve.dm.ListItemNode} Model to observe
*/
ve.ce.ListItemNode = function( model ) {
// Inheritance
ve.ce.BranchNode.call( this, model, $( '<li></li>' ) );
};
/* Static Members */
/**
* Node rules.
*
* @see ve.ce.NodeFactory
* @static
* @member
*/
ve.ce.ListItemNode.rules = {
'canHaveChildren': true,
'canHaveGrandchildren': true,
'canBeSplit': false
};
/* Registration */
ve.ce.factory.register( 'listItem', ve.ce.ListItemNode );
/* Inheritance */
ve.extendClass( ve.ce.ListItemNode, ve.ce.BranchNode );