Issues (108)

Menu/MenuItems/TCellSplitMenuItemDispatcher.js (1 issue)

1 View Code Duplication
import { splitCell } from 'prosemirror-tables';
0 ignored issues
show
This code seems to be duplicated in your project.
Loading history...
2
import AbstractMenuItemDispatcher from './AbstractMenuItemDispatcher';
3
import { svgIcon } from '../MDI';
4
import MenuItem from '../MenuItem';
5
6
export default class TCellSplitMenuItemDispatcher extends AbstractMenuItemDispatcher {
7
    static isAvailable(schema) {
8
        return !!schema.nodes.table;
9
    }
10
11
    static getMenuItem(schema) {
12
        if (!this.isAvailable(schema)) {
13
            throw new Error('Table not available in schema!');
14
        }
15
16
        return new MenuItem({
17
            command: splitCell,
18
            icon: svgIcon('arrow-split-vertical'),
19
            label: LANG.plugins.prosemirror['label:table-cell-split'],
20
        });
21
    }
22
}
23