Debian Codegraph @

extensions/VisualEditor/lib/ve/src/ui/commands/ve.ui.MergeCellsCommand.js

raw symbols SCIP
1 /*!
2 * VisualEditor UserInterface MergeCellsCommand class.
3 *
4 * @copyright See AUTHORS.txt
5 */
6
7 /**
8 * UserInterface merge cells command.
9 *
10 * @class
11 * @extends ve.ui.Command
12 *
13 * @constructor
14 */
15 ve.ui.MergeCellsCommand = function VeUiMergeCellsCommand() {
16 // Parent constructor
17 ve.ui.MergeCellsCommand.super.call(
18 this, 'mergeCells', 'table', 'mergeCells',
19 { supportedSelections: [ 'table' ] }
20 );
21 };
22
23 /* Inheritance */
24
25 OO.inheritClass( ve.ui.MergeCellsCommand, ve.ui.Command );
26
27 /* Methods */
28
29 /**
30 * @inheritdoc
31 */
32 ve.ui.MergeCellsCommand.prototype.isExecutable = function ( fragment ) {
33 // Parent method
34 return ve.ui.MergeCellsCommand.super.prototype.isExecutable.apply( this, arguments ) &&
35 fragment.getSelection().isMergeable( fragment.getDocument() );
36 };
37
38 /* Registration */
39
40 ve.ui.commandRegistry.register( new ve.ui.MergeCellsCommand() );