diff options
author | rubenwardy <rw@rubenwardy.com> | 2019-01-28 23:40:31 +0000 |
---|---|---|
committer | rubenwardy <rw@rubenwardy.com> | 2019-01-28 23:40:31 +0000 |
commit | f112756b04f9038cfef950b7a8bafc4d4ad95346 (patch) | |
tree | 907b85a7d6aa046f7d89c7aec9183840b12aa694 | |
parent | f822027ec590b4c92dad85d5499f6e478a5e472c (diff) | |
download | cheatdb-f112756b04f9038cfef950b7a8bafc4d4ad95346.tar.xz |
Disable fields in bulk change on checkbox
-rw-r--r-- | app/templates/packages/release_bulk_change.html | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/app/templates/packages/release_bulk_change.html b/app/templates/packages/release_bulk_change.html index f416ada..b9a7e40 100644 --- a/app/templates/packages/release_bulk_change.html +++ b/app/templates/packages/release_bulk_change.html @@ -41,4 +41,25 @@ {% block scriptextra %} <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 %} |