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

Commit

Permalink
Internal: Adjusted to use the new API.
Browse files Browse the repository at this point in the history
  • Loading branch information
mlewand committed Mar 10, 2020
1 parent f952d62 commit 92545d0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/commands/setheadercolumncommand.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import Command from '@ckeditor/ckeditor5-core/src/command';

import { updateNumericAttribute } from './utils';
import { getTableCellsInSelection } from '../tableselection/utils';
import { getSelectionAffectedTableCells } from '../utils';

/**
* The header column command.
Expand All @@ -33,7 +33,7 @@ export default class SetHeaderColumnCommand extends Command {
*/
refresh() {
const model = this.editor.model;
const selectedCells = getTableCellsInSelection( model.document.selection, true );
const selectedCells = getSelectionAffectedTableCells( model.document.selection );
const isInTable = selectedCells.length > 0;

this.isEnabled = isInTable;
Expand Down Expand Up @@ -65,7 +65,7 @@ export default class SetHeaderColumnCommand extends Command {
const model = this.editor.model;
const tableUtils = this.editor.plugins.get( 'TableUtils' );

const selectedCells = getTableCellsInSelection( model.document.selection, true );
const selectedCells = getSelectionAffectedTableCells( model.document.selection );
const firstCell = selectedCells[ 0 ];
const lastCell = selectedCells[ selectedCells.length - 1 ];
const tableRow = firstCell.parent;
Expand Down
6 changes: 3 additions & 3 deletions src/commands/setheaderrowcommand.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import Command from '@ckeditor/ckeditor5-core/src/command';

import { createEmptyTableCell, updateNumericAttribute } from './utils';
import { getTableCellsInSelection } from '../tableselection/utils';
import { getSelectionAffectedTableCells } from '../utils';
import TableWalker from '../tablewalker';

/**
Expand All @@ -33,7 +33,7 @@ export default class SetHeaderRowCommand extends Command {
*/
refresh() {
const model = this.editor.model;
const selectedCells = getTableCellsInSelection( model.document.selection, true );
const selectedCells = getSelectionAffectedTableCells( model.document.selection );
const isInTable = selectedCells.length > 0;

this.isEnabled = isInTable;
Expand Down Expand Up @@ -64,7 +64,7 @@ export default class SetHeaderRowCommand extends Command {
execute( options = {} ) {
const model = this.editor.model;

const selectedCells = getTableCellsInSelection( model.document.selection, true );
const selectedCells = getSelectionAffectedTableCells( model.document.selection );
const firstCell = selectedCells[ 0 ];
const lastCell = selectedCells[ selectedCells.length - 1 ];
const table = firstCell.parent.parent;
Expand Down

0 comments on commit 92545d0

Please sign in to comment.