fixed small issue in vanilla js filter idea
This commit is contained in:
parent
d0dac94911
commit
0e9506e326
@ -26,7 +26,7 @@ def getpublications():
|
|||||||
pubinfo = {
|
pubinfo = {
|
||||||
"Title": row["Publication"],
|
"Title": row["Publication"],
|
||||||
"Author": row["Author"],
|
"Author": row["Author"],
|
||||||
"Type": row["Type"],
|
"Type": row["Type"].lower(),
|
||||||
"Year": year,
|
"Year": year,
|
||||||
}
|
}
|
||||||
publications[row["Id"]] = pubinfo
|
publications[row["Id"]] = pubinfo
|
||||||
|
@ -26,8 +26,8 @@ function update() {
|
|||||||
|
|
||||||
filterSelection("all")
|
filterSelection("all")
|
||||||
function filterSelection(c) {
|
function filterSelection(c) {
|
||||||
var x, i;
|
var i;
|
||||||
allpublications = document.getElementsByClassName("filter");
|
var allpublications = document.getElementsByClassName("filter");
|
||||||
if (c == "all") {
|
if (c == "all") {
|
||||||
for (i = 0; i < allpublications.length; i++) {
|
for (i = 0; i < allpublications.length; i++) {
|
||||||
addClass(allpublications[i], "show");
|
addClass(allpublications[i], "show");
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{% block menu %}
|
{% block menu %}
|
||||||
<a href="/"><button>All books</button></a>
|
<button onclick="filterSelection('all')">All books</button>
|
||||||
<a href="/upload"><button>Upload</button></a>
|
<button><a href="/upload">Upload</a></button>
|
||||||
<div class="dropdown">
|
<div class="dropdown">
|
||||||
<button class="dropbtn">Type</button>
|
<button class="dropbtn">Type</button>
|
||||||
<div class="dropdown-content">
|
<div class="dropdown-content">
|
||||||
|
Loading…
Reference in New Issue
Block a user