mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-16 10:59:56 +00:00
9887dbd96f
* 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
36 lines
644 B
JavaScript
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 );
|