forked from server/soundboard
Add reset button for search
This commit is contained in:
parent
8cfdac8580
commit
72f1125618
@ -64,6 +64,15 @@ section {
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#reset {
|
||||||
|
font-size: 2em;
|
||||||
|
padding-left: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#reset:hover {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
.sound {
|
.sound {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -42,6 +42,16 @@ ready(function() {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
var reset = document.querySelector("#reset");
|
||||||
|
|
||||||
|
reset.addEventListener("click", function() {
|
||||||
|
var buttons = document.querySelectorAll(".sound");
|
||||||
|
|
||||||
|
buttons.forEach(function(item) {
|
||||||
|
item.style.display = "inline-block";
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
function hideSections() {
|
function hideSections() {
|
||||||
|
|||||||
@ -13,7 +13,7 @@
|
|||||||
</nav>
|
</nav>
|
||||||
<content>
|
<content>
|
||||||
<section id="sounds">
|
<section id="sounds">
|
||||||
<div><input type="text" id="search" /></div>
|
<div><input type="text" id="search" /><span id="reset">⨯</span></div>
|
||||||
{% for sound in sounds %}
|
{% for sound in sounds %}
|
||||||
<div class="sound"><a href="{{ '/play/' + sound }}">{{ sound.split('.', 1)[0] }}</a></div>
|
<div class="sound"><a href="{{ '/play/' + sound }}">{{ sound.split('.', 1)[0] }}</a></div>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user