Allow selecting all notifications on the page at once

close #1743
This commit is contained in:
Umar Bolatov 2020-07-16 21:52:40 -07:00
parent 561caf966a
commit 08db3b1613
No known key found for this signature in database
GPG Key ID: 2C1F9AEB371D2A28

View File

@ -21,7 +21,6 @@
</div>
<form method="post" asp-action="MassAction">
<div class="row button-row">
<div class="col-lg-6">
<span class="dropdown" style="display:none;" id="MassAction">
@ -41,7 +40,12 @@
<table class="table table-sm table-responsive-md">
<thead>
<tr>
<th width="30px" class="only-for-js"></th>
<th width="30px" class="only-for-js">
@if (Model.Total > 0)
{
<input name="selectedItems" type="checkbox" onClick="selectAll(this);" />
}
</th>
<th width="190px">
Date
<a href="javascript:switchTimeFormat()">
@ -192,6 +196,14 @@ tr.seen td {
updateSelectors();
}
function selectAll(sender){
var inputs = $(".notification-row").find(".selector");
inputs.each(function (index, input) {
$(input).prop("checked", !$(input).prop("checked"));
});
updateSelectors();
}
$(function () {
$(".selector").change(updateSelectors);
updateSelectors();