Skip to content

Commit e4ad441

Browse files
committed
Merge branch 't/8024' into major
2 parents e75f82a + c63a75d commit e4ad441

File tree

7 files changed

+69
-12
lines changed

7 files changed

+69
-12
lines changed

CHANGES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ Fixed Issues:
2828

2929
Other Changes:
3030

31+
* [#8024](http://dev.ckeditor.com/ticket/8024): Swapped behavior of the Split Table Cell Vertically and Horizontally features to be more intuitive. Thanks to [kevinisagit](https://github.com/kevinisagit)!
3132
* [#10903](http://dev.ckeditor.com/ticket/10903): Performance improvements for [`addClass`](http://docs.ckeditor.com/#!/api/CKEDITOR.dom.element-method-addClass), [`removeClass`](http://docs.ckeditor.com/#!/api/CKEDITOR.dom.element-method-removeClass) and [`hasClass`](http://docs.ckeditor.com/#!/api/CKEDITOR.dom.element-method-hasClass) methods.
3233
* [#11856](http://dev.ckeditor.com/ticket/11856): jQuery adapter throw an meaningful error if CKEditor or jQuery is not loaded.
3334
* [#12150](http://dev.ckeditor.com/ticket/12150): Expose [`getNestedEditable`](http://docs.ckeditor.com/#!/api/CKEDITOR.plugins.widget-static-method-getNestedEditable) and `is*` [widget helper](http://docs.ckeditor.com/#!/api/CKEDITOR.plugins.widget) functions.

plugins/tabletools/plugin.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,7 @@
537537
}
538538
}
539539

540-
function verticalSplitCell( selection, isDetect ) {
540+
function horizontalSplitCell( selection, isDetect ) {
541541
var cells = getSelectedCells( selection );
542542
if ( cells.length > 1 )
543543
return false;
@@ -602,7 +602,7 @@
602602
return newCell;
603603
}
604604

605-
function horizontalSplitCell( selection, isDetect ) {
605+
function verticalSplitCell( selection, isDetect ) {
606606
var cells = getSelectedCells( selection );
607607
if ( cells.length > 1 )
608608
return false;
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<div id="editor">
2+
<table border="1" cellpadding="1" cellspacing="1" style="width: 500px">
3+
<tbody>
4+
<tr>
5+
<td>he^re</td>
6+
</tr>
7+
</tbody>
8+
</table>
9+
</div>
10+
11+
<script>
12+
CKEDITOR.replace( 'editor' );
13+
</script>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
@bender-tags: 4.5.0, tc
2+
@bender-ui: collapsed
3+
@bender-ckeditor-plugins: wysiwygarea, toolbar, table, tabletools
4+
5+
1. Place caret in the table cell.
6+
1. Open the context menu.
7+
1. Choose:
8+
1. "Cell".
9+
1. "Split Cell **Horizontally**".
10+
11+
Expected:
12+
13+
1. New cell is created below the original one.
14+
1. Table has two rows, one column.
15+
1. Caret is located in the bottom cell.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<div id="editor">
2+
<table border="1" cellpadding="1" cellspacing="1" style="width: 500px">
3+
<tbody>
4+
<tr>
5+
<td>he^re</td>
6+
</tr>
7+
</tbody>
8+
</table>
9+
</div>
10+
11+
<script>
12+
CKEDITOR.replace( 'editor' );
13+
</script>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
@bender-tags: 4.5.0, tc
2+
@bender-ui: collapsed
3+
@bender-ckeditor-plugins: wysiwygarea, toolbar, table, tabletools
4+
5+
1. Place caret in the table cell.
6+
1. Open the context menu.
7+
1. Choose:
8+
1. "Cell".
9+
1. "Split Cell **Vertically**".
10+
11+
Expected:
12+
13+
1. New cell is created on the right hand side of the original one.
14+
1. Table has one row, two columns.
15+
1. Caret is located in the right cell.

tests/plugins/tabletools/tabletools.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -87,51 +87,51 @@
8787
},
8888

8989
'test split cells': function() {
90-
this.doTest( 'split-cells', 'cellVerticalSplit' );
90+
this.doTest( 'split-cells', 'cellHorizontalSplit' );
9191
},
9292

9393
'test split cells (2)': function() {
94-
this.doTest( 'split-cells-2', 'cellVerticalSplit' );
94+
this.doTest( 'split-cells-2', 'cellHorizontalSplit' );
9595
},
9696

9797
'test split cells (3)': function() {
98-
this.doTest( 'split-cells-3', 'cellVerticalSplit' );
98+
this.doTest( 'split-cells-3', 'cellHorizontalSplit' );
9999
},
100100

101101
'test split cells (4)': function() {
102-
this.doTest( 'split-cells-4', 'cellHorizontalSplit' );
102+
this.doTest( 'split-cells-4', 'cellVerticalSplit' );
103103
},
104104

105105
'test split cells (5)': function() {
106-
this.doTest( 'split-cells-5', 'cellHorizontalSplit' );
106+
this.doTest( 'split-cells-5', 'cellVerticalSplit' );
107107
},
108108

109109
'test split cells (6)': function() {
110-
this.doTest( 'split-cells-6', 'cellHorizontalSplit' );
110+
this.doTest( 'split-cells-6', 'cellVerticalSplit' );
111111
},
112112

113113
'test split cells (7)': function() {
114114
var bot = this.editorBot;
115115
bender.tools.testInputOut( 'split-cells-7', function( source, expected ) {
116116
bot.setHtmlWithSelection( source );
117-
bot.execCommand( 'cellVerticalSplit' );
117+
bot.execCommand( 'cellHorizontalSplit' );
118118

119119
var range = new CKEDITOR.dom.range( bot.editor.document );
120120
range.moveToPosition( bot.editor.document.getById( 'cursor' ), CKEDITOR.POSITION_AFTER_START );
121121
range.select();
122122

123-
bot.execCommand( 'cellHorizontalSplit' );
123+
bot.execCommand( 'cellVerticalSplit' );
124124
assert.areSame( bender.tools.compatHtml( expected ), bot.getData( true ) );
125125
} );
126126
},
127127

128128
// (#11438)
129129
'test split cells (8)': function() {
130-
this.doTest( 'split-cells-8', 'cellVerticalSplit' );
130+
this.doTest( 'split-cells-8', 'cellHorizontalSplit' );
131131
},
132132

133133
'test split cells (9)': function() {
134-
this.doTest( 'split-cells-9', 'cellVerticalSplit' );
134+
this.doTest( 'split-cells-9', 'cellHorizontalSplit' );
135135
},
136136

137137
// (#6111)

0 commit comments

Comments
 (0)