Files
nairobi/app/assets/javascripts/legislation_admin.js
Javi Martín b8e352145c Use prop() instead of removeAttr()
According to the jQuery upgrade guide:

> It is almost always a mistake to use .removeAttr("checked") on a DOM
> element. The only time it might be useful is if the DOM is later going
> to be serialized back to an HTML string. In all other cases,
> .prop("checked", false) should be used instead.
2020-08-28 16:10:31 +02:00

22 lines
627 B
JavaScript

(function() {
"use strict";
App.LegislationAdmin = {
initialize: function() {
$(".legislation-process-form").find("[name$='enabled]'],[name$='[published]']").on({
change: function() {
var checkbox;
checkbox = $(this);
checkbox.closest("fieldset").find("input[type='date']").each(function() {
$(this).prop("disabled", !checkbox.is(":checked"));
});
}
}).trigger("change");
$("#nested_question_options").on("cocoon:after-insert", function() {
App.Globalize.refresh_visible_translations();
});
}
};
}).call(this);