diff options
author | Steven Day <steve@mysociety.org> | 2015-06-23 16:00:52 +0100 |
---|---|---|
committer | Steven Day <steve@mysociety.org> | 2015-06-29 12:43:01 +0100 |
commit | 53314bb25e2ff7ddde33fabcd2f4505d09fcc220 (patch) | |
tree | f54bcc11bde114e78efaff76fa55cd449c9b7eb8 | |
parent | 0176b3c6918fbfa6ee22f24066d3a3d8850c8cca (diff) |
Refresh map pins when status dropdown changes, if present
-rw-r--r-- | web/js/map-OpenLayers.js | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/web/js/map-OpenLayers.js b/web/js/map-OpenLayers.js index bb78191a8..5b8deec06 100644 --- a/web/js/map-OpenLayers.js +++ b/web/js/map-OpenLayers.js @@ -116,9 +116,8 @@ function fms_markers_resize() { fixmystreet.markers.redraw(); } -function fms_categories_changed() { - // If the category has changed we need to re-fetch markers that match - // the new value +function fms_categories_or_status_changed() { + // If the category or status has changed we need to re-fetch map markers fixmystreet.markers.refresh({force: true}); } @@ -257,7 +256,11 @@ function fixmystreet_onload() { // If the category filter dropdown exists on the page set up the // event handlers to populate it and react to it changing if ($("select#categories").length) { - $("body").on("change", "#categories", fms_categories_changed); + $("body").on("change", "#categories", fms_categories_or_status_changed); + } + // Do the same for the status dropdown + if ($("select#statuses").length) { + $("body").on("change", "#statuses", fms_categories_or_status_changed); } } else if (fixmystreet.page == 'new') { fixmystreet_activate_drag(); |