diff --git a/lcc/src/js/legislation_filter.js b/lcc/src/js/legislation_filter.js index 8f4865c..771321d 100644 --- a/lcc/src/js/legislation_filter.js +++ b/lcc/src/js/legislation_filter.js @@ -264,6 +264,27 @@ $(document).ready(function() { }); }); + $('.classification-parrent').change(function(){ + if(this.checked) { + $(this).closest('li').find('input').prop('checked', true); + $(this).closest('li').find('input').each(function(i, input){ + let $input = $(input); + classifications.push($input.val()) + }); + payload['classifications'] = classifications; + } else { + $(this).closest('li').find('input').prop('checked', false); + $(this).closest('li').find('input').each(function(i, input){ + let $input = $(input); + let index = payload['classifications'].indexOf($input.val()); + if (index > -1) { + payload['classifications'].splice(index, 1); + } + }); + } + $('.classification-parrent').val(this.checked); + }); + // Handle search and filters $('#textSearchInput').on('change', function() { diff --git a/lcc/src/less/legislation-explorer.less b/lcc/src/less/legislation-explorer.less index 5463132..7a247da 100644 --- a/lcc/src/less/legislation-explorer.less +++ b/lcc/src/less/legislation-explorer.less @@ -236,5 +236,6 @@ li.select-deselect { } .logical_cat_name { - margin-bottom: 5px; + margin-bottom: 10px; + margin-top: 15px; } \ No newline at end of file diff --git a/lcc/templates/legislation/explorer.html b/lcc/templates/legislation/explorer.html index 2b8001d..7a67652 100644 --- a/lcc/templates/legislation/explorer.html +++ b/lcc/templates/legislation/explorer.html @@ -38,7 +38,7 @@ {% include "./_laws.html" %}
-

Filter legislation

+

Filter legislation

Select Legal Area
@@ -48,14 +48,14 @@
Select Legal Area
    {% for logical_cat in logical_categories %} - {{ logical_cat.name }}
    • +

      {{ logical_cat.name }}

      {% for top_class in logical_cat.taxonomy_classifications.all %}
    • {% with top_class.get_children as second_classifications %} - + {% if second_classifications %} @@ -72,7 +72,7 @@
      Select Legal Area
      {% with second_class.get_children as third_classifications %}
    • - + {% if third_classifications %}