Skip to content
This repository was archived by the owner on Jun 26, 2020. It is now read-only.

Commit ce09c39

Browse files
author
Piotr Jasiun
authored
Merge pull request #156 from ckeditor/t/ckeditor5-core/148
Other: Change to string reference for TableUtils when using editor.plugins.get.
2 parents 9ba1acf + e00c534 commit ce09c39

File tree

7 files changed

+7
-13
lines changed

7 files changed

+7
-13
lines changed

src/commands/insertcolumncommand.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
import Command from '@ckeditor/ckeditor5-core/src/command';
1111
import { findAncestor } from './utils';
12-
import TableUtils from '../tableutils';
1312

1413
/**
1514
* The insert column command.
@@ -70,7 +69,7 @@ export default class InsertColumnCommand extends Command {
7069
execute() {
7170
const editor = this.editor;
7271
const selection = editor.model.document.selection;
73-
const tableUtils = editor.plugins.get( TableUtils );
72+
const tableUtils = editor.plugins.get( 'TableUtils' );
7473

7574
const firstPosition = selection.getFirstPosition();
7675

src/commands/insertrowcommand.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
import Command from '@ckeditor/ckeditor5-core/src/command';
1111
import { findAncestor } from './utils';
12-
import TableUtils from '../tableutils';
1312

1413
/**
1514
* The insert row command.
@@ -69,7 +68,7 @@ export default class InsertRowCommand extends Command {
6968
execute() {
7069
const editor = this.editor;
7170
const selection = editor.model.document.selection;
72-
const tableUtils = editor.plugins.get( TableUtils );
71+
const tableUtils = editor.plugins.get( 'TableUtils' );
7372

7473
const tableCell = findAncestor( 'tableCell', selection.getFirstPosition() );
7574
const tableRow = tableCell.parent;

src/commands/inserttablecommand.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
import Command from '@ckeditor/ckeditor5-core/src/command';
1111
import { findOptimalInsertionPosition } from '@ckeditor/ckeditor5-widget/src/utils';
12-
import TableUtils from '../tableutils';
1312

1413
/**
1514
* The insert table command.
@@ -49,7 +48,7 @@ export default class InsertTableCommand extends Command {
4948
execute( options = {} ) {
5049
const model = this.editor.model;
5150
const selection = model.document.selection;
52-
const tableUtils = this.editor.plugins.get( TableUtils );
51+
const tableUtils = this.editor.plugins.get( 'TableUtils' );
5352

5453
const rows = parseInt( options.rows ) || 2;
5554
const columns = parseInt( options.columns ) || 2;

src/commands/mergecellcommand.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
import Command from '@ckeditor/ckeditor5-core/src/command';
1111
import TableWalker from '../tablewalker';
1212
import { findAncestor, updateNumericAttribute } from './utils';
13-
import TableUtils from '../tableutils';
1413

1514
/**
1615
* The merge cell command.
@@ -127,7 +126,7 @@ export default class MergeCellCommand extends Command {
127126
return;
128127
}
129128

130-
const tableUtils = this.editor.plugins.get( TableUtils );
129+
const tableUtils = this.editor.plugins.get( 'TableUtils' );
131130

132131
// First get the cell on proper direction.
133132
const cellToMerge = this.isHorizontal ?

src/commands/removecolumncommand.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
import Command from '@ckeditor/ckeditor5-core/src/command';
1111

1212
import TableWalker from '../tablewalker';
13-
import TableUtils from '../tableutils';
1413
import { findAncestor, updateNumericAttribute } from './utils';
1514

1615
/**
@@ -31,7 +30,7 @@ export default class RemoveColumnCommand extends Command {
3130
refresh() {
3231
const editor = this.editor;
3332
const selection = editor.model.document.selection;
34-
const tableUtils = editor.plugins.get( TableUtils );
33+
const tableUtils = editor.plugins.get( 'TableUtils' );
3534

3635
const tableCell = findAncestor( 'tableCell', selection.getFirstPosition() );
3736

src/commands/splitcellcommand.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
*/
99

1010
import Command from '@ckeditor/ckeditor5-core/src/command';
11-
import TableUtils from '../tableutils';
1211
import { findAncestor } from './utils';
1312

1413
/**
@@ -68,7 +67,7 @@ export default class SplitCellCommand extends Command {
6867

6968
const isHorizontally = this.direction === 'horizontally';
7069

71-
const tableUtils = this.editor.plugins.get( TableUtils );
70+
const tableUtils = this.editor.plugins.get( 'TableUtils' );
7271

7372
if ( isHorizontally ) {
7473
tableUtils.splitCellHorizontally( tableCell, 2 );

src/tableediting.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ export default class TableEditing extends Plugin {
228228
const isLastRow = currentRowIndex === table.childCount - 1;
229229

230230
if ( isForward && isLastRow && isLastCellInRow ) {
231-
editor.plugins.get( TableUtils ).insertRows( table, { at: table.childCount } );
231+
editor.plugins.get( 'TableUtils' ).insertRows( table, { at: table.childCount } );
232232
}
233233

234234
let cellToFocus;

0 commit comments

Comments
 (0)