Skip to content

Commit

Permalink
Make IDs for toggles in table unique.
Browse files Browse the repository at this point in the history
  • Loading branch information
uhafner committed Jun 1, 2023
1 parent 27a22a8 commit ab9a753
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
10 changes: 5 additions & 5 deletions plugin/src/main/resources/coverage/coverage-table.jelly
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@
<div class="col-12 d-xxl-none">
<bs:card title="${title}" symbol="${symbol}" class="flex-fill h-100" >
<j:if test="${showChangedToggle}">
<f:toggleSwitch name="changed" title="Show only changed files" />
<f:toggleSwitch id="changed-${id + '-table'}" title="${%changed.files}" />
</j:if>
<dt:table model="${it.getTableModel(id + '-table')}"/>
</bs:card>
</div>
<div class="col-xxl-6 d-none d-xxl-block">
<bs:card title="${title}" symbol="${symbol}" class="flex-fill h-100">
<j:if test="${showChangedToggle}">
<f:toggleSwitch name="changed" title="Show only changed files" />
<f:toggleSwitch id="changed-${id + '-table-inline'}" title="${%changed.files}" />
</j:if>
<dt:table model="${it.getTableModel(id + '-table-inline')}"/>
</bs:card>
Expand All @@ -50,15 +50,15 @@
<fa:svg-icon name="hand-point-left" class="no-selection-banner"/>
</div>
<div class="text-center">
<h5 class="card-title">${%Please select a file in the table to open the source code}</h5>
<h5 class="card-title">${%select.row}</h5>
</div>
</div>
<div id="${id}-no-source">
<div class="text-center">
<fa:svg-icon name="ban" class="no-selection-banner"/>
</div>
<div class="text-center">
<h5 class="card-title">${%No source code available for this file}</h5>
<h5 class="card-title">${%no.sourcecode}</h5>
</div>
</div>
</bs:card>
Expand All @@ -67,7 +67,7 @@
<j:otherwise>
<div class="col-12">
<j:if test="${showChangedToggle}">
<f:toggleSwitch name="changed" title="Show only changed files" />
<f:toggleSwitch id="changed-${id + '-table'}" title="${%changed.files}" />
</j:if>
<bs:card title="${title}" symbol="${symbol}" class="flex-fill h-100">
<dt:table model="${it.getTableModel(id + '-table')}"/>
Expand Down
3 changes: 3 additions & 0 deletions plugin/src/main/resources/coverage/coverage-table.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
changed.files=Show only changed files
select.row=Please select a file in the table to open the source code
no.sourcecode=No source code available for this file
2 changes: 1 addition & 1 deletion plugin/src/main/webapp/js/view-model.js
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ const CoverageChartGenerator = function ($) {
initializeSourceCodeSelection('change-coverage');
initializeSourceCodeSelection('indirect-coverage');

$('input[name="changed"]').on('change', function () {
$('input[id ^= "changed"]').on('change', function () {
const showChanged = $(this).prop('checked');
$('table.data-table').each(function () {
const table = $(this).DataTable();
Expand Down

0 comments on commit ab9a753

Please sign in to comment.