diff --git a/html/static/js/address-or-report-suggestion.js b/html/static/js/address-or-report-suggestion.js index cf82e66a..6c40eec2 100644 --- a/html/static/js/address-or-report-suggestion.js +++ b/html/static/js/address-or-report-suggestion.js @@ -164,24 +164,23 @@ class AddressOrReportInput extends HTMLElement { this.shadowRoot.querySelectorAll('.suggestion-item').forEach(el => { el.addEventListener('click', e => { const type = el.dataset.type; + let detail = null; if (type == "report") { const index = parseInt(el.dataset.index); - const report = this._reports[index]; - this.value = _formatReportID(report.id); + detail = this._reports[index]; + this.value = _formatReportID(detail.id); this._suggestionsContainer.innerHTML = ""; } else if (type == "address") { const index = parseInt(el.dataset.index); - const address = this._addresses[index]; - this.SetValue(address); + detail = this._addresses[index]; + this.SetValue(detail); // Dispatch custom event - this.dispatchEvent(new CustomEvent('address-selected', { - bubbles: true, - composed: true, // Allows event to cross shadow DOM boundary - detail: { - location: address - } - })); } + this.dispatchEvent(new CustomEvent('suggestion-selected', { + bubbles: true, + composed: true, // Allows event to cross shadow DOM boundary + detail: detail, + })); }); }); } diff --git a/rmo/template/base.html b/rmo/template/base.html index 327dc56c..d96bdd81 100644 --- a/rmo/template/base.html +++ b/rmo/template/base.html @@ -15,6 +15,7 @@ {{ block "extraheader" . }}{{ end }} - - - - - +{{ define "title" }}Status{{ end }} +{{ define "extraheader" }} + + + + + + -{{end}} -{{define "content"}} -{{if (eq .District nil)}} - {{template "header-rmo" .}} -{{else}} - {{template "header-district" .District}} -{{end}} -
- -