mirror of https://github.com/MISP/MISP
fix: [UI] Multi select on the event index fixed, fixes #5047
parent
e4708c0b6c
commit
be52e65ebd
|
@ -61,12 +61,12 @@
|
|||
|
||||
</tr>
|
||||
<?php foreach ($events as $event): ?>
|
||||
<tr <?php if ($event['Event']['distribution'] == 0) echo 'class = "privateRed"'?>>
|
||||
<tr <?php if ($event['Event']['distribution'] == 0) echo 'class = "privateRed"'?> id="event_<?php echo h($event['Event']['id']);?>">
|
||||
<?php
|
||||
if ($isSiteAdmin || ($event['Event']['orgc_id'] == $me['org_id'])):
|
||||
?>
|
||||
<td style="width:10px;" data-id="<?php echo h($event['Event']['id']); ?>">
|
||||
<input class="select" type="checkbox" data-id="<?php echo $event['Event']['id'];?>" />
|
||||
<input id="<?php echo h($event['Event']['id']); ?>" class="select" type="checkbox" data-id="<?php echo h($event['Event']['id']);?>" />
|
||||
</td>
|
||||
<?php
|
||||
else:
|
||||
|
@ -240,10 +240,20 @@
|
|||
<?php endforeach; ?>
|
||||
</table>
|
||||
<script type="text/javascript">
|
||||
var lastSelected = false;
|
||||
$(document).ready(function() {
|
||||
$('.select').on('change', function() {
|
||||
listCheckboxesChecked();
|
||||
});
|
||||
$('.select').click(function(e) {
|
||||
if ($(this).is(':checked')) {
|
||||
if (e.shiftKey) {
|
||||
selectAllInbetween(lastSelected, this.id);
|
||||
}
|
||||
lastSelected = this.id;
|
||||
}
|
||||
attributeListAnyAttributeCheckBoxesChecked();
|
||||
});
|
||||
|
||||
$('.distributionNetworkToggle').each(function() {
|
||||
$(this).distributionNetwork({
|
||||
|
|
|
@ -3708,7 +3708,7 @@ function selectAllInbetween(last, current) {
|
|||
from = to;
|
||||
to = temp;
|
||||
}
|
||||
$('.select_proposal, .select_attribute').each(function () {
|
||||
$('.select_proposal, .select_attribute, .select').each(function (e) {
|
||||
if ($('#' + this.id).parent().parent().index() >= from && $('#' + this.id).parent().parent().index() <= to) {
|
||||
$(this).prop('checked', true);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue