* Resolve feedback #36186.

This commit is contained in:
zhouxin
2022-10-31 13:21:00 +08:00
parent fa39994e50
commit cd5415309e
4 changed files with 44 additions and 3 deletions
+12
View File
@@ -73,6 +73,18 @@ $(function()
$('tr:first').addClass("show-detail");
$('#tr-detail_1').removeClass("hide");
});
$('#resultsContainer').click(function(event)
{
if(event.target.id.indexOf('checkAll') !== -1)
{
var checkAll = document.getElementById(event.target.id);
var checkAll = $(checkAll);
var isChecked = checkAll.prop('checked');
checkAll.closest('tbody').children('tr').find('input[type=checkbox]').prop('checked', isChecked);
}
});
});
var sessionString = '<?php echo session_name() . '=' . session_id();?>';
</script>
+12 -1
View File
@@ -23,5 +23,16 @@ $(function()
$('#casesResults table caption .result-tip').html($('#resultTip').html());
$('tr:first').click();
});
$('#casesResults').click(function(event)
{
if(event.target.id.indexOf('checkAll') !== -1)
{
var checkAll = document.getElementById(event.target.id);
var checkAll = $(checkAll);
var isChecked = checkAll.prop('checked');
checkAll.closest('tbody').children('tr').find('input[type=checkbox]').prop('checked', isChecked);
}
});
});
+12
View File
@@ -111,4 +111,16 @@ $(document).ready(function()
$next = $next.next();
}
});
$('#resultsContainer').click(function(event)
{
if(event.target.id.indexOf('checkAll') !== -1)
{
var checkAll = document.getElementById(event.target.id);
var checkAll = $(checkAll);
var isChecked = checkAll.prop('checked');
checkAll.closest('tbody').children('tr').find('input[type=checkbox]').prop('checked', isChecked);
}
});
});
+8 -2
View File
@@ -36,7 +36,7 @@
</caption>
<?php endif;?>
<?php $failCount = 0; $trCount=1?>
<?php foreach($results as $result):?>
<?php foreach($results as $i => $result):?>
<?php
$class = ($result->caseResult == 'pass' ? 'success' : ($result->caseResult == 'fail' ? 'danger' : ($result->caseResult == 'blocked' ? 'warning' : '')));
if($class != 'success') $failCount++;
@@ -122,7 +122,13 @@
<?php endforeach;?>
<?php if($result->caseResult == 'fail' and common::hasPriv('testcase', 'createBug')):?>
<tr>
<td></td><td></td><td></td><td></td><td></td><td></td>
<td>
<div class="checkbox-primary">
<input type='checkbox' id='<?php echo "checkAll[$i]";?>' name='checkAll' />
<label><?php echo $lang->selectAll?></label>
</div>
</td>
<td></td><td></td><td></td><td></td><td></td>
<td><?php echo html::commonButton($lang->testcase->createBug, "onclick='createBug(this)'", "btn btn-primary createBtn");?></td>
</tr>
<?php endif;?>