Skip to content

Commit ebe3d3e

Browse files
committed
Merge branch 't/10472' into major
2 parents 8c3adbb + 28f2be5 commit ebe3d3e

File tree

4 files changed

+63
-7
lines changed

4 files changed

+63
-7
lines changed

CHANGES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Fixed Issues:
88
* [#16811](http://dev.ckeditor.com/ticket/16811): Fixed: Pasted from Word table alignment not preserved.
99
* [#16810](http://dev.ckeditor.com/ticket/16810): Fixed: Vertical align in tables not supported by [Paste from Word](http://ckeditor.com/addon/pastefromword) plugin.
1010
* [#11956](http://dev.ckeditor.com/ticket/11956): [Blink, IE] Fixed: [Link](http://ckeditor.com/addon/link) dialog does not open on a double click on the second word of the link with background color or other styles.
11+
* [#10472](http://dev.ckeditor.com/ticket/10472): Fixed: Unable to use [Table Resize](http://ckeditor.com/addon/tableresize) on table's header and footer.
1112

1213
## CKEditor 4.6.2
1314

plugins/tableresize/plugin.js

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,18 @@
6060
// Get the tbody element and position, which will be used to set the
6161
// top and bottom boundaries.
6262
var tbody = new CKEDITOR.dom.element( table.$.tBodies[ 0 ] ),
63-
tbodyPosition = tbody.getDocumentPosition();
63+
pillarPosition = tbody.getDocumentPosition(),
64+
pillarHeight = tbody.$.offsetHeight;
65+
66+
if ( table.$.tHead ) {
67+
var tHead = new CKEDITOR.dom.element( table.$.tHead );
68+
pillarPosition = tHead.getDocumentPosition();
69+
pillarHeight += tHead.$.offsetHeight;
70+
}
71+
72+
if ( table.$.tFoot ) {
73+
pillarHeight += table.$.tFoot.offsetHeight;
74+
}
6475

6576
// Loop thorugh all cells, building pillars after each one of them.
6677
for ( var i = 0, len = $tr.cells.length; i < len; i++ ) {
@@ -100,9 +111,9 @@
100111
table: table,
101112
index: pillarIndex,
102113
x: pillarLeft,
103-
y: tbodyPosition.y,
114+
y: pillarPosition.y,
104115
width: pillarWidth,
105-
height: tbody.$.offsetHeight,
116+
height: pillarHeight,
106117
rtl: rtl
107118
} );
108119
}
@@ -126,7 +137,7 @@
126137
}
127138

128139
function columnResizer( editor ) {
129-
var pillar, document, resizer, isResizing, startOffset, currentShift;
140+
var pillar, document, resizer, isResizing, startOffset, currentShift, move;
130141

131142
var leftSideCells, rightSideCells, leftShiftBoundary, rightShiftBoundary;
132143

@@ -313,7 +324,7 @@
313324
resizer.show();
314325
};
315326

316-
var move = this.move = function( posX ) {
327+
move = this.move = function( posX ) {
317328
if ( !pillar )
318329
return 0;
319330

@@ -388,11 +399,12 @@
388399
return;
389400
}
390401

391-
// Considering table, tr, td, tbody but nothing else.
402+
// Considering table, tr, td, tbody, thead, tfoot but nothing else.
392403
var table, pillars;
393404

394-
if ( !target.is( 'table' ) && !target.getAscendant( 'tbody', 1 ) )
405+
if ( !target.is( 'table' ) && !target.getAscendant( { thead: 1, tbody: 1, tfoot: 1 }, 1 ) ) {
395406
return;
407+
}
396408

397409
table = target.getAscendant( 'table', 1 );
398410

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<div id="editor">
2+
<table border="1" cellpadding="1" cellspacing="1" style="width:500px">
3+
<thead>
4+
<tr>
5+
<th scope="row" style="width:227px">Header</th>
6+
<th scope="col" style="width:90px">Header</th>
7+
<th scope="col" style="width:165px">Header</th>
8+
</tr>
9+
</thead>
10+
<tbody>
11+
<tr>
12+
<th scope="row" style="width:227px">Header</th>
13+
<td style="width:90px">&nbsp;not header</td>
14+
<td style="width:165px">not header</td>
15+
</tr>
16+
<tr>
17+
<th scope="row" style="width:227px">Header</th>
18+
<td style="width:90px">not header</td>
19+
<td style="width:165px">not header</td>
20+
</tr>
21+
</tbody>
22+
<tfoot>
23+
<tr>
24+
<th scope="row" style="width:227px">Header Footer</th>
25+
<td style="width:90px">footer</td>
26+
<td style="width:165px">footer</td>
27+
</tr>
28+
</tfoot>
29+
</table>
30+
</div>
31+
32+
<script>
33+
CKEDITOR.replace( 'editor' );
34+
</script>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
@bender-ui: collapsed
2+
@bender-tags: tc, 10472, 4.7.0
3+
@bender-ckeditor-plugins: wysiwygarea, toolbar, table, tableresize, basicstyles, undo
4+
5+
Drag one of the vertical borders separating the cells (inner borders) by holding the part in the first/last row.
6+
7+
**Expected**: Dragging by these parts is possible, the shadowy pillar created when dragging is the height of the table.
8+
9+
**Unexpected**: Dragging by these parts is not possible, the shadowy pillar is shorter than the height of the table.

0 commit comments

Comments
 (0)