Merge pull request #1684 from bookwyrm-social/remove-checkall

Removes check_all javascript that is no longer used
This commit is contained in:
Mouse Reeve 2021-12-27 12:47:21 -08:00 committed by GitHub
commit 38c132e251
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 0 additions and 38 deletions

View file

@ -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);
});
})();

View file

@ -234,7 +234,3 @@
</div>
{% endif %}
{% endspaceless %}{% endblock %}
{% block scripts %}
<script src="{% static "js/check_all.js" %}?v={{ js_cache }}"></script>
{% endblock %}