From 869f122ce9f52c25e69d2a2e138d6d471fb25965 Mon Sep 17 00:00:00 2001 From: Kuba Niegowski Date: Wed, 6 May 2020 20:34:13 +0200 Subject: [PATCH] Insert row above/below in reasonable order in the menu. --- packages/ckeditor5-table/src/tableui.js | 8 ++++---- packages/ckeditor5-table/tests/tableui.js | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/ckeditor5-table/src/tableui.js b/packages/ckeditor5-table/src/tableui.js index 993ef454ae3..ceb19bd2aef 100644 --- a/packages/ckeditor5-table/src/tableui.js +++ b/packages/ckeditor5-table/src/tableui.js @@ -141,15 +141,15 @@ export default class TableUI extends Plugin { { type: 'button', model: { - commandName: 'insertTableRowBelow', - label: t( 'Insert row below' ) + commandName: 'insertTableRowAbove', + label: t( 'Insert row above' ) } }, { type: 'button', model: { - commandName: 'insertTableRowAbove', - label: t( 'Insert row above' ) + commandName: 'insertTableRowBelow', + label: t( 'Insert row below' ) } }, { diff --git a/packages/ckeditor5-table/tests/tableui.js b/packages/ckeditor5-table/tests/tableui.js index f4956f7eb85..60a86623b6b 100644 --- a/packages/ckeditor5-table/tests/tableui.js +++ b/packages/ckeditor5-table/tests/tableui.js @@ -139,7 +139,7 @@ describe( 'TableUI', () => { const labels = listView.items.map( item => item instanceof ListSeparatorView ? '|' : item.children.first.label ); expect( labels ).to.deep.equal( - [ 'Header row', '|', 'Insert row below', 'Insert row above', 'Delete row', 'Select row' ] + [ 'Header row', '|', 'Insert row above', 'Insert row below', 'Delete row', 'Select row' ] ); } ); @@ -170,12 +170,12 @@ describe( 'TableUI', () => { expect( items.first.children.first.isEnabled ).to.be.false; expect( dropdown.buttonView.isEnabled ).to.be.true; - insertRowBelowCommand.isEnabled = false; + insertRowAboveCommand.isEnabled = false; expect( items.get( 2 ).children.first.isEnabled ).to.be.false; expect( dropdown.buttonView.isEnabled ).to.be.true; - insertRowAboveCommand.isEnabled = false; + insertRowBelowCommand.isEnabled = false; expect( items.get( 3 ).children.first.isEnabled ).to.be.false; expect( dropdown.buttonView.isEnabled ).to.be.true;