From 257b6a53187c4200aa26e13d18a1be569cab2088 Mon Sep 17 00:00:00 2001 From: Zarino Zappia Date: Fri, 15 Feb 2019 18:12:58 +0000 Subject: Duplicate suggestion UI when reporting problems. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- web/js/map-OpenLayers.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'web/js/map-OpenLayers.js') 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; } -- cgit v1.2.3