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.
22 lines
627 B
JavaScript
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);
|