mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-16 02:51:50 +00:00
625161e35c
Change-Id: I3825199c3c8cbe3b50c01e03f39f20cef7c55a28
54 lines
980 B
JavaScript
54 lines
980 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
|
|
};
|
|
|
|
/* Methods */
|
|
|
|
ve.ce.BreakNode.prototype.canHaveSlugBefore = function () {
|
|
return true;
|
|
};
|
|
|
|
ve.ce.BreakNode.prototype.canHaveSlugAfter = function () {
|
|
return true;
|
|
};
|
|
|
|
/* Registration */
|
|
|
|
ve.ce.nodeFactory.register( 'break', ve.ce.BreakNode );
|
|
|
|
/* Inheritance */
|
|
|
|
ve.extendClass( ve.ce.BreakNode, ve.ce.LeafNode );
|