Skip to content

Commit 43401d2

Browse files
committed
Restore resizer div height and thus the overall column resizing
We have to remove the static div elements in the HTML template because datatables will include all of them in a span for the header cell content, overwriting the original table structure, and must instead perform our own overwriting afterwards. The div elements are added to each table header cell if they are not already present to add them just once for all table redraws. If the div is instead wrapped in a span by datatables this will lead to its dynamically calculated height to be added to ever increasing table header cell height and degrade the table headers. The current change achieves the same structure we had before but with multiple spans (for content and for sorting arrows) now with datatables 2. Signed-off-by: Plamen Dimitrov <plamen.dimitrov@intra2net.com>
1 parent 93b19ce commit 43401d2

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

optional_plugins/html/avocado_result_html/templates/avocado_html.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,12 @@
7777
// this should be called each table we have a redrawn
7878
this.setupResizers = function() {
7979
var self = this;
80-
table.find('.resizer').each(function() {
81-
var resizerElement = $(this);
80+
table.find('th').each(function() {
81+
if ($(this).find('.resizer').length == 0) {
82+
// we only need one resizer per header cell
83+
$(this).append('<div class="resizer"></div>')
84+
}
85+
var resizerElement = $(this).find('.resizer');
8286
// the resizer must have the same size as the header cell to be detectable
8387
resizerElement.height(resizerElement.parent().outerHeight())
8488
// we detach and reattach each event to prevent them from being triggered

optional_plugins/html/avocado_result_html/templates/results.html

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -64,35 +64,27 @@ <h4 class="panel-title">Summary</h4>
6464
<tr>
6565
<th>
6666
<span>Start Time</span>
67-
<div class="resizer"></div>
6867
</th>
6968
<th>
7069
<span>UID</span>
71-
<div class="resizer"></div>
7270
</th>
7371
<th>
7472
<span>Test Name</span>
75-
<div class="resizer"></div>
7673
</th>
7774
<th>
7875
<span>Variant</span>
79-
<div class="resizer"></div>
8076
</th>
8177
<th>
8278
<span>Status</span>
83-
<div class="resizer"></div>
8479
</th>
8580
<th>
8681
<span>Time (sec)</span>
87-
<div class="resizer"></div>
8882
</th>
8983
<th>
9084
<span>Info</span>
91-
<div class="resizer"></div>
9285
</th>
9386
<th>
9487
<span>Debug</span>
95-
<div class="resizer"></div>
9688
</th>
9789
</tr>
9890
</thead>

0 commit comments

Comments
 (0)