moodle/grade/amd/build/edittree_index.min.js

3 lines
1.1 KiB
JavaScript

define ("core_grades/edittree_index",["jquery"],function(a){var b=function(){a("body").on("change",".itemselect.ignoredirty",b.checkMoveMenuState);a("body").on("click","[data-action=\"grade_edittree-index-bulkselect\"]",b.toggleAllSelectItems);a("body").on("change",".weightoverride",b.toggleWeightInput);a("#menumoveafter").on("change",function(){var b=a(this).closest("form"),c=b.find("#bulkmoveinput");c.val(1);b.submit()});b.checkMoveMenuState()};b.toggleWeightInput=function(b){b.preventDefault();var c=a(this),d=c.closest("tr");a("input[name=\"weight_"+d.data("itemid")+"\"]").prop("disabled",!c.prop("checked"))};b.toggleAllSelectItems=function(c){c.preventDefault();var d=a(this),e=d.closest("tr");a("."+e.data("category")+" .itemselect").prop("checked",d.data("checked"));b.checkMoveMenuState()};b.getMoveMenu=function(){return a("#menumoveafter")};b.checkMoveMenuState=function(){var c=b.getMoveMenu();if(!c.length){return!1}var d;a(".itemselect").each(function(){d=a(this).prop("checked");return!d});c.prop("disabled",!d);return d};return{enhance:b}});
//# sourceMappingURL=edittree_index.min.js.map