aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Arter <davea@mysociety.org>2015-03-24 14:13:13 +0000
committerDave Arter <davea@mysociety.org>2015-07-23 11:46:37 +0100
commita5d74c06da94b3b157097a23cfff65296edb45b4 (patch)
treeececb99213946781b8b22db9179648b85ec99ee2
parent8a0010e1d8c891d8ff75ad972e2d2f7d15a82f84 (diff)
[Oxfordshire] Refresh map as soon as filters are changed on empty /my
By default the map JS doesn't get included on /my if the map is empty, so there's some slight duplication of the JS from the previous commit to make the filters submit the form as soon as they're changed. This should be included in the base template if/when the filters make their way there.
-rw-r--r--templates/web/oxfordshire/my/_problem-list.html14
1 files changed, 14 insertions, 0 deletions
diff --git a/templates/web/oxfordshire/my/_problem-list.html b/templates/web/oxfordshire/my/_problem-list.html
index 1365dccd3..e0f16586a 100644
--- a/templates/web/oxfordshire/my/_problem-list.html
+++ b/templates/web/oxfordshire/my/_problem-list.html
@@ -7,3 +7,17 @@
[% INCLUDE 'reports/_list-entry.html', problem = p, no_fixed =1 %]
[% "</ul>" IF loop.last %]
[% END %]
+
+[% IF ! problems.size %]
+<!-- Preserve behaviour of map filters despite map not being shown -->
+<script type="text/javascript">
+ (function($) {
+ $(function() {
+ $(".report-list-filters [type=submit]").hide();
+ $(".report-list-filters select").change(function() {
+ $(this).closest("form").submit();
+ });
+ })
+ })(window.jQuery);
+</script>
+[% END %]