Debian Codegraph @

extensions/VisualEditor/lib/ve/src/ce/nodes/ve.ce.ParagraphNode.js

raw symbols SCIP
1 /*!
2 * VisualEditor ContentEditable ParagraphNode class.
3 *
4 * @copyright See AUTHORS.txt
5 */
6
7 /**
8 * ContentEditable paragraph node.
9 *
10 * @class
11 * @extends ve.ce.ContentBranchNode
12 * @constructor
13 * @param {ve.dm.ParagraphNode} model Model to observe
14 * @param {Object} [config] Configuration options
15 */
16 ve.ce.ParagraphNode = function VeCeParagraphNode() {
17 // Parent constructor
18 ve.ce.ParagraphNode.super.apply( this, arguments );
19
20 // DOM changes
21 if (
22 this.model.getElement().internal &&
23 this.model.getElement().internal.generated === 'wrapper'
24 ) {
25 this.$element.addClass( 've-ce-generated-wrapper' );
26 }
27 };
28
29 /* Inheritance */
30
31 OO.inheritClass( ve.ce.ParagraphNode, ve.ce.ContentBranchNode );
32
33 /* Static Properties */
34
35 ve.ce.ParagraphNode.static.name = 'paragraph';
36
37 ve.ce.ParagraphNode.static.tagName = 'p';
38
39 /* Methods */
40
41 /**
42 * @inheritdoc
43 */
44 ve.ce.ParagraphNode.prototype.initialize = function () {
45 ve.ce.ParagraphNode.super.prototype.initialize.call( this );
46 this.$element.addClass( 've-ce-paragraphNode' );
47 };
48
49 /* Registration */
50
51 ve.ce.nodeFactory.register( ve.ce.ParagraphNode );