Browse Source

dropdown js fix

current_wdka_release
crunk 3 years ago
parent
commit
2d34ab0af5
  1. 4
      verse/static/js/dropdown.js
  2. 6
      verse/templates/filtermenu.html

4
verse/static/js/dropdown.js

@ -1,10 +1,10 @@
filterSelection("all", "None"); filterSelection("all", "None");
function filterSelection(c, id) { function filterSelection(c, name, id) {
resetDropDownButtons(); resetDropDownButtons();
var i; var i;
var button = document.getElementById(id); var button = document.getElementById(id);
if(button){ if(button){
button.innerText = c; button.innerText = name;
addClass(button, "activebtn"); addClass(button, "activebtn");
} }
var alldistribusis = document.getElementsByClassName("filter"); var alldistribusis = document.getElementsByClassName("filter");

6
verse/templates/filtermenu.html

@ -4,7 +4,7 @@
<button id="Academicyear" class="dropbtn">Academic year</button> <button id="Academicyear" class="dropbtn">Academic year</button>
<div class="dropdown-content"> <div class="dropdown-content">
{% for year in years %} {% for year in years %}
<button type="button" name="button" onclick="filterSelection('{{ year[0] }}', 'Academicyear')" >{{ year[1] }}</button> <button type="button" name="button" onclick="filterSelection('{{ year[0] }}', '{{ year[1] }}', 'Academicyear')" >{{ year[1] }}</button>
{% endfor %} {% endfor %}
</div> </div>
</div> </div>
@ -12,7 +12,7 @@
<button id="Term" class="dropbtn">Term</button> <button id="Term" class="dropbtn">Term</button>
<div class="dropdown-content"> <div class="dropdown-content">
{% for term in terms %} {% for term in terms %}
<button type="button" name="button" onclick="filterSelection('{{ term[0] }}', 'Term')" >{{ term[1] }}</button> <button type="button" name="button" onclick="filterSelection('{{ term[0] }}', '{{ term[1] }}', 'Term')" >{{ term[1] }}</button>
{% endfor %} {% endfor %}
</div> </div>
</div> </div>
@ -20,7 +20,7 @@
<button id="Course" class="dropbtn">Course</button> <button id="Course" class="dropbtn">Course</button>
<div class="dropdown-content"> <div class="dropdown-content">
{% for course in courses %} {% for course in courses %}
<button type="button" name="button" onclick="filterSelection('{{ course[0] }}', 'Course')" >{{ course[1] }}</button> <button type="button" name="button" onclick="filterSelection('{{ course[0] }}' , '{{ course[1] }}', 'Course')" >{{ course[1] }}</button>
{% endfor %} {% endfor %}
</div> </div>
</div> </div>

Loading…
Cancel
Save