diff --git a/src/ims/element/incident/incident_template/template.xhtml b/src/ims/element/incident/incident_template/template.xhtml index 7bc116e5d..96688600e 100644 --- a/src/ims/element/incident/incident_template/template.xhtml +++ b/src/ims/element/incident/incident_template/template.xhtml @@ -14,8 +14,9 @@
n
: create new Incident h
: toggle showing system-generated history n
: create (n)ew Incident a
: jump to (a)dd new report texth
: toggle showing system-generated (h)istory Keyboard shortcuts
n
: create new Incident n
: create (n)ew Incident /
: jump to search field In the search field
@@ -150,7 +150,7 @@ id="search_input" type="search" class="form-control search-box" - placeholder="Search" + placeholder="Press " ⁄ " to search" inputmode="latin" autocomplete="off" aria-controls="queue_table" diff --git a/src/ims/element/incident/report_template/template.xhtml b/src/ims/element/incident/report_template/template.xhtml index 9c31fcb93..abdb296a2 100644 --- a/src/ims/element/incident/report_template/template.xhtml +++ b/src/ims/element/incident/report_template/template.xhtml @@ -14,8 +14,9 @@n
: create new Field Report h
: toggle showing system-generated history n
: create (n)ew Field Report a
: jump to (a)dd new report texth
: toggle showing system-generated (h)istory Keyboard shortcuts
n
: create new Field Report n
: create (n)ew Field Report /
: jump to search field In the search field
@@ -110,7 +110,7 @@ id="search_input" type="search" class="form-control search-box" - placeholder="Search" + placeholder="Press " ⁄ " to search" inputmode="latin" autocomplete="off" aria-controls="field_reports_table" diff --git a/src/ims/element/page/_page.py b/src/ims/element/page/_page.py index 51ef4f23b..27d4c076e 100644 --- a/src/ims/element/page/_page.py +++ b/src/ims/element/page/_page.py @@ -74,7 +74,8 @@ def add(name: str) -> None: if name == "dataTables": add("dataTablesBootstrap") - add("dataTablesResponsive") + # Responsive is currently unused. See incidents.js as well. + # add("dataTablesResponsive") # All pages use Bootstrap add("bootstrap") diff --git a/src/ims/element/static/field_report.js b/src/ims/element/static/field_report.js index e67c51a9c..858eb2406 100644 --- a/src/ims/element/static/field_report.js +++ b/src/ims/element/static/field_report.js @@ -66,6 +66,13 @@ function initFieldReportPage() { if (e.key === "?") { $("#helpModal").modal("toggle"); } + // a --> jump to add a new report entry + if (e.key === "a") { + e.preventDefault(); + // Scroll to report_entry_add field + $("html, body").animate({scrollTop: $("#report_entry_add").offset().top}, 500); + $("#report_entry_add").focus(); + } // h --> toggle showing system entries if (e.key.toLowerCase() === "h") { document.getElementById("history_checkbox").click(); diff --git a/src/ims/element/static/incident.js b/src/ims/element/static/incident.js index ed15114e6..0a07a5d07 100644 --- a/src/ims/element/static/incident.js +++ b/src/ims/element/static/incident.js @@ -27,13 +27,9 @@ function initIncidentPage() { loadIncidentTypes(drawIncidentTypesToAdd); loadAllFieldReports(renderFieldReportData); - // for a new incident + // for a new incident, jump to summary field if (incident.number == null) { $("#incident_summary").focus(); - } else { - // Scroll to report_entry_add field - $("html, body").animate({scrollTop: $("#report_entry_add").offset().top}, 500); - $("#report_entry_add").focus(); } // Warn the user if they're about to navigate away with unsaved text. @@ -96,6 +92,13 @@ function initIncidentPage() { if (e.key === "?") { $("#helpModal").modal("toggle"); } + // a --> jump to add a new report entry + if (e.key === "a") { + e.preventDefault(); + // Scroll to report_entry_add field + $("html, body").animate({scrollTop: $("#report_entry_add").offset().top}, 500); + $("#report_entry_add").focus(); + } // h --> toggle showing system entries if (e.key.toLowerCase() === "h") { document.getElementById("history_checkbox").click();