Skip to content

Commit ac2a7fc

Browse files
georges-armTamarChristinaArm
authored andcommitted
Fix run select-all checkbox when floating.
When the user scrolls past the table header, the header moves to float at the top of the window so that the column headers are still visible. The way this is implemented means that the logic for selecting all checkboxes does not work when the header is floating (since it is no longer a child of the table itself). This commit fixes this by simply creating a unique element id for the table and passing that around instead, which allows the checkboxes to be found in all cases. Change-Id: I9ff2cf0a22c485b2fc0d2a5cc0689819cf87201b
1 parent 7169365 commit ac2a7fc

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lnt/server/ui/templates/v4_run.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
<link href="{{ url_for('.static', filename='lnt_run.css') }}" rel="stylesheet" media="screen"/>
2424

2525
<script type="text/javascript">
26-
function selectAll(source) {
27-
$(source).closest("table").find("input:checkbox").prop("checked", source.checked);
26+
function selectAll(source, target) {
27+
$(target).find("input:checkbox").prop("checked", source.checked);
2828
}
2929
</script>
3030
{% endblock %}
@@ -327,10 +327,10 @@ <h4>Parameters</h4>
327327
{% set unit_suffix = ' (%s)' % field.unit if field.unit else '' %}
328328
{% set title = field.display_name + unit_suffix %}
329329
{{ utils.render_popup_begin('test_data-' + field.name, title, false) }}
330-
<table class="table table-striped table-hover table-condensed floating_header datatable">
330+
<table class="table table-striped table-hover table-condensed floating_header datatable" id="run-data-{{ field.name }}">
331331
<thead>
332332
<tr>
333-
<th rowspan="1" class="sorttable_nosort"><input type="checkbox" id="select-all-{{ field.name }}" onClick="selectAll(this)"/></th>
333+
<th rowspan="1" class="sorttable_nosort"><input type="checkbox" id="select-all-{{ field.name }}" onClick="selectAll(this, '#run-data-{{ field.name }}')"/></th>
334334
<th rowspan="1">Name</th>
335335
{% if options.show_previous %}<th>Prev</th>{% endif %}
336336
<th>Current</th>

0 commit comments

Comments
 (0)