mirror of
https://github.com/minetest/contentdb.git
synced 2025-01-10 23:17:37 +01:00
Disable fields in bulk change on checkbox
This commit is contained in:
parent
f822027ec5
commit
f112756b04
@ -41,4 +41,25 @@
|
|||||||
|
|
||||||
{% block scriptextra %}
|
{% block scriptextra %}
|
||||||
<script src="/static/release_minmax.js?v=1"></script>
|
<script src="/static/release_minmax.js?v=1"></script>
|
||||||
|
<script>
|
||||||
|
function setup_toggle(type) {
|
||||||
|
var toggle = $("#set_" + type);
|
||||||
|
function on_change() {
|
||||||
|
if (toggle.is(":checked")) {
|
||||||
|
$("#" + type + "_rel").removeAttr("disabled");
|
||||||
|
$("#" + type + "_rel").parent().css("opacity", "1");
|
||||||
|
} else {
|
||||||
|
$("#" + type + "_rel").attr("disabled", "disabled");
|
||||||
|
$("#" + type + "_rel").parent().css("opacity", "0.4");
|
||||||
|
$("#" + type + "_rel").val($("#" + type + "_rel option:first-child").attr("value"));
|
||||||
|
$("#" + type + "_rel").change();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
toggle.change(on_change);
|
||||||
|
on_change();
|
||||||
|
}
|
||||||
|
|
||||||
|
setup_toggle("min");
|
||||||
|
setup_toggle("max");
|
||||||
|
</script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
Loading…
Reference in New Issue
Block a user