mirror of
https://git.ianrenton.com/ian/spothole.git
synced 2026-02-04 09:14:30 +00:00
Fix a bug in the mobile view where the second line doesn't get painted green for SSE new spots. Closes #87
This commit is contained in:
@@ -182,9 +182,6 @@ function createNewTableRowsForSpot(s, highlightNew) {
|
|||||||
|
|
||||||
// Create row
|
// Create row
|
||||||
let $tr = $('<tr>');
|
let $tr = $('<tr>');
|
||||||
if (highlightNew) {
|
|
||||||
$tr.addClass("new");
|
|
||||||
}
|
|
||||||
|
|
||||||
// Apply striping to the table. We can't just use Bootstrap's table-striped class because we have all sorts of
|
// Apply striping to the table. We can't just use Bootstrap's table-striped class because we have all sorts of
|
||||||
// extra faff to deal with, like the mobile view having extra rows, and the On Now / Next 24h / Later banners
|
// extra faff to deal with, like the mobile view having extra rows, and the On Now / Next 24h / Later banners
|
||||||
@@ -198,6 +195,12 @@ function createNewTableRowsForSpot(s, highlightNew) {
|
|||||||
$tr.addClass("table-faded");
|
$tr.addClass("table-faded");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If we are asked to highlight new rows (i.e. this row is being added "live" via the SSE client and not as a bulk
|
||||||
|
// reload of the whole table)
|
||||||
|
if (highlightNew) {
|
||||||
|
$tr.addClass("new");
|
||||||
|
}
|
||||||
|
|
||||||
// Format a UTC or local time for display
|
// Format a UTC or local time for display
|
||||||
var time = moment.unix(s["time"]).utc();
|
var time = moment.unix(s["time"]).utc();
|
||||||
if (useLocalTime) {
|
if (useLocalTime) {
|
||||||
@@ -341,12 +344,18 @@ function createNewTableRowsForSpot(s, highlightNew) {
|
|||||||
|
|
||||||
// Second row for mobile view only, containing type, ref & comment
|
// Second row for mobile view only, containing type, ref & comment
|
||||||
$tr2 = $("<tr class='hidenotonmobile'>");
|
$tr2 = $("<tr class='hidenotonmobile'>");
|
||||||
|
|
||||||
|
// Apply styles as per the first row
|
||||||
if (rowCount % 2 == 1) {
|
if (rowCount % 2 == 1) {
|
||||||
$tr2.addClass("table-active");
|
$tr2.addClass("table-active");
|
||||||
}
|
}
|
||||||
if (s["qrt"] == true) {
|
if (s["qrt"] == true) {
|
||||||
$tr2.addClass("table-faded");
|
$tr2.addClass("table-faded");
|
||||||
}
|
}
|
||||||
|
if (highlightNew) {
|
||||||
|
$tr.addClass("new");
|
||||||
|
}
|
||||||
|
|
||||||
$td2 = $("<td colspan='100'>");
|
$td2 = $("<td colspan='100'>");
|
||||||
if (showType) {
|
if (showType) {
|
||||||
$td2.append(`<span class='icon-wrapper'><i class='fa-solid fa-${s["icon"]}'></i></span> ${typeText} `);
|
$td2.append(`<span class='icon-wrapper'><i class='fa-solid fa-${s["icon"]}'></i></span> ${typeText} `);
|
||||||
|
|||||||
Reference in New Issue
Block a user