Merge #15579 - Fix checkbox selection

Pull-request: #15579
Fixes: #15578
Fixes: #15327

Signed-off-by: William Desportes <williamdes@wdes.fr>
This commit is contained in:
William Desportes 2019-11-22 00:26:45 +01:00
commit 70d5ba995c
No known key found for this signature in database
GPG Key ID: 90A0EF1B8251A889

View File

@ -1046,7 +1046,7 @@ AJAX.registerOnload('functions.js', function () {
last_click_checked = checked;
// remember the last clicked row
last_clicked_row = last_click_checked ? $table.find('tr:not(.noclick)').index($tr) : -1;
last_clicked_row = last_click_checked ? $table.find('tbody tr:not(.noclick)').index($tr) : -1;
last_shift_clicked_row = -1;
} else {
// handle the shift click
@ -1072,7 +1072,7 @@ AJAX.registerOnload('functions.js', function () {
}
// handle new shift click
var curr_row = $table.find('tr:not(.noclick)').index($tr);
var curr_row = $table.find('tbody tr:not(.noclick)').index($tr);
if (curr_row >= last_clicked_row) {
start = last_clicked_row;
end = curr_row;
@ -1081,7 +1081,7 @@ AJAX.registerOnload('functions.js', function () {
end = last_clicked_row;
}
$tr.parent().find('tr:not(.noclick)')
.slice(start, end)
.slice(start, end + 1)
.addClass('marked')
.find(':checkbox')
.prop('checked', true)