diff options
author | Zarino Zappia <mail@zarino.co.uk> | 2019-02-15 18:12:58 +0000 |
---|---|---|
committer | Matthew Somerville <matthew-github@dracos.co.uk> | 2019-02-25 12:19:50 +0000 |
commit | 257b6a53187c4200aa26e13d18a1be569cab2088 (patch) | |
tree | f3bab52058a53f1e4fd050fe002e53d9f0ab98f0 /web/js/map-OpenLayers.js | |
parent | 0c8aae1ab17617f46f400bab81bb7a3b144b4a1e (diff) |
Duplicate suggestion UI when reporting problems.
The previously staff-only fixmystreet.set_up.manage_duplicates() has
been promoted from staff.js to its own file so that we can use it to
display the duplicate suggestions on the `/report/new` form.
render_duplicate_list (the old refresh_duplicate_list) no longer filters
or slices the reports_list returned by the ajax call, since it turns out
the server handles all of that (`sub _nearby_json` in `Report.pm` and
`sub nearby` in `Nearby.pm`).
Since the expandable list items include the "fancybox" image previews,
the fancybox CSS now has to be included in the `/report/new` page head,
hence the addition of "photo-js.html" in `fill_in_details.html`.
The “Get updates” flow reuses the same JavaScript that handles the
submission of the "Get updates" drawer at the bottom of around pages.
Diffstat (limited to 'web/js/map-OpenLayers.js')
-rw-r--r-- | web/js/map-OpenLayers.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/web/js/map-OpenLayers.js b/web/js/map-OpenLayers.js index fdfeed314..984f4b098 100644 --- a/web/js/map-OpenLayers.js +++ b/web/js/map-OpenLayers.js @@ -381,15 +381,15 @@ $.extend(fixmystreet.utils, { function sidebar_highlight(problem_id) { if (typeof problem_id !== 'undefined') { - var $a = $('.item-list--reports a[href$="/' + problem_id + '"]'); - $a.parent().addClass('hovered'); + var $li = $('[data-report-id="' + problem_id + '"]'); + $li.addClass('hovered'); } else { - $('.item-list--reports .hovered').removeClass('hovered'); + $('.item-list .hovered').removeClass('hovered'); } } function marker_click(problem_id, evt) { - var $a = $('.item-list--reports a[href$="/' + problem_id + '"]'); + var $a = $('.item-list a[href$="/' + problem_id + '"]'); if (!$a[0]) { return; } |