mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-12-28 19:10:35 +00:00
Removes check_all javascript that is no longer used
This commit is contained in:
parent
f7c6cb3598
commit
8bda0bc0dc
2 changed files with 0 additions and 38 deletions
|
@ -1,34 +0,0 @@
|
||||||
|
|
||||||
(function() {
|
|
||||||
'use strict';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Toggle all descendant checkboxes of a target.
|
|
||||||
*
|
|
||||||
* Use `data-target="ID_OF_TARGET"` on the node on which the event is listened
|
|
||||||
* to (checkbox, button, link…), where_ID_OF_TARGET_ should be the ID of an
|
|
||||||
* ancestor for the checkboxes.
|
|
||||||
*
|
|
||||||
* @example
|
|
||||||
* <input
|
|
||||||
* type="checkbox"
|
|
||||||
* data-action="toggle-all"
|
|
||||||
* data-target="failed-imports"
|
|
||||||
* >
|
|
||||||
* @param {Event} event
|
|
||||||
* @return {undefined}
|
|
||||||
*/
|
|
||||||
function toggleAllCheckboxes(event) {
|
|
||||||
const mainCheckbox = event.target;
|
|
||||||
|
|
||||||
document
|
|
||||||
.querySelectorAll(`#${mainCheckbox.dataset.target} [type="checkbox"]`)
|
|
||||||
.forEach(checkbox => checkbox.checked = mainCheckbox.checked);
|
|
||||||
}
|
|
||||||
|
|
||||||
document
|
|
||||||
.querySelectorAll('[data-action="toggle-all"]')
|
|
||||||
.forEach(input => {
|
|
||||||
input.addEventListener('change', toggleAllCheckboxes);
|
|
||||||
});
|
|
||||||
})();
|
|
|
@ -234,7 +234,3 @@
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endspaceless %}{% endblock %}
|
{% endspaceless %}{% endblock %}
|
||||||
|
|
||||||
{% block scripts %}
|
|
||||||
<script src="{% static "js/check_all.js" %}?v={{ js_cache }}"></script>
|
|
||||||
{% endblock %}
|
|
||||||
|
|
Loading…
Reference in a new issue