mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-25 14:56:20 +00:00
522eb08fdc
Change-Id: I2bfd08eab1cd45a193d91540bc0602549884fa89
44 lines
810 B
JavaScript
44 lines
810 B
JavaScript
/**
|
|
* VisualEditor content editable BreakNode class.
|
|
*
|
|
* @copyright 2011-2012 VisualEditor Team and others; see AUTHORS.txt
|
|
* @license The MIT License (MIT); see LICENSE.txt
|
|
*/
|
|
|
|
/**
|
|
* ContentEditable node for a line break.
|
|
*
|
|
* @class
|
|
* @constructor
|
|
* @extends {ve.ce.LeafNode}
|
|
* @param model {ve.dm.BreakNode} Model to observe
|
|
*/
|
|
ve.ce.BreakNode = function ( model ) {
|
|
// Inheritance
|
|
ve.ce.LeafNode.call( this, 'break', model, $( '<br>' ) );
|
|
|
|
// DOM Changes
|
|
this.$.addClass( 've-ce-BreakNode' );
|
|
};
|
|
|
|
/* Static Members */
|
|
|
|
/**
|
|
* Node rules.
|
|
*
|
|
* @see ve.ce.NodeFactory
|
|
* @static
|
|
* @member
|
|
*/
|
|
ve.ce.BreakNode.rules = {
|
|
'canBeSplit': false
|
|
};
|
|
|
|
/* Registration */
|
|
|
|
ve.ce.nodeFactory.register( 'break', ve.ce.BreakNode );
|
|
|
|
/* Inheritance */
|
|
|
|
ve.extendClass( ve.ce.BreakNode, ve.ce.LeafNode );
|