forked from mirrors/bookwyrm
Merge pull request #1684 from bookwyrm-social/remove-checkall
Removes check_all javascript that is no longer used
This commit is contained in:
commit
38c132e251
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