Skip to content

Latest commit

 

History

History
58 lines (53 loc) · 1.59 KB

index.md

File metadata and controls

58 lines (53 loc) · 1.59 KB
layout title
page
New books
All New Books {% for department in site.data.departments %} {{ department.name }} {% endfor %}
{% for book in site.data.books %}
Call number: {{ book.call_number }}
    {% if book.author %}
      <strong>Author:</strong>
      {{ book.author }}<br />
    {% endif %}
  </span>
</div>

{% endfor %}

<script> function applyFilter() { var dropdown = document.getElementById('filter'); var selectedDepartment = dropdown[dropdown.selectedIndex].id; var gridEntries = document.getElementsByClassName('grid-item'); for (var i = 0; i < gridEntries.length; ++i) { gridEntries[i].classList.remove('hidden'); } if (selectedDepartment != "all") { var departments = {{ site.data.departments | jsonify }}; var match = departments.find(function(department) { return department['name'] == selectedDepartment; }); if (match) { for (var i = 0; i < gridEntries.length; ++i) { if (match['book_ids'].indexOf(gridEntries[i].id) == -1) { gridEntries[i].classList.add('hidden'); } } } } } </script>