Moving to structure where click on td is counted as seen

This commit is contained in:
rockstardev 2020-06-10 23:40:40 -05:00
parent 0b89598f39
commit 3680e03cdb

View file

@ -31,19 +31,20 @@
<table class="table table-sm table-responsive-md">
<thead>
<tr>
<th width="30px"></th>
<th width="165px">Date</th>
<th>Message</th>
<th width="70px">&nbsp;</th>
<th width="70px">&nbsp;</th>
</tr>
</thead>
<tbody>
@foreach (var item in Model.Items)
{
@* TODO: Multiselect akin to Gmail *@
<tr onclick="rowseen(this)" data-guid="@item.Id">
<td class="cursor-pointer @(item.Seen ? "": "font-weight-bold")">@item.Created.ToBrowserDate()</td>
<td class="cursor-pointer @(item.Seen ? "": "font-weight-bold")">@item.Body</td>
<tr data-guid="@item.Id">
<td><input type="checkbox" class="selector" data-guid="@item.Id" /></td>
<td onclick="rowseen(this)" class="cursor-pointer @(item.Seen ? "": "font-weight-bold")">@item.Created.ToBrowserDate()</td>
<td onclick="rowseen(this)" class="cursor-pointer @(item.Seen ? "": "font-weight-bold")">@item.Body</td>
<td>
@if (!String.IsNullOrEmpty(item.ActionLink))
{
@ -54,9 +55,6 @@
<span>&nbsp;</span>
}
</td>
<td>
<a asp-action="Delete" asp-route-id="@item.Id" onclick="return confirm('Are you sure you want to delete this notification');"><span class="fa fa-trash-o" title="Delete"></span></a>
</td>
</tr>
}
</tbody>
@ -74,10 +72,9 @@
<script type="text/javascript">
function rowseen(sender) {
var weightClassName = "font-weight-bold";
$(sender).children().eq(0).toggleClass(weightClassName);
$(sender).children().eq(1).toggleClass(weightClassName);
$(sender).parent().children(".cursor-pointer").toggleClass(weightClassName);
$.post("/Notifications/FlipRead/" + $(sender).data("guid"), function (data) {
$.post("/Notifications/FlipRead/" + $(sender).parent().data("guid"), function (data) {
});
}
</script>