fix: [UI] Multi select on the event index fixed, fixes #5047

pull/5048/head
iglocska 2019-08-23 14:24:45 +02:00
parent e4708c0b6c
commit be52e65ebd
No known key found for this signature in database
GPG Key ID: BEA224F1FEF113AC
2 changed files with 13 additions and 3 deletions

View File

@ -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({

View File

@ -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);
}