mirror of
https://github.com/moodle/moodle.git
synced 2025-07-18 21:01:27 +02:00
3 lines
887 B
JavaScript
3 lines
887 B
JavaScript
define ("core_form/defaultcustom",["jquery"],function(a){a("body").on("change","input[data-defaultcustom=true]",function onChangeSelect(b){var c=a(b.target),d=JSON.parse(c.attr("data-defaultvalue")),e=JSON.parse(c.attr("data-customvalue")),f=c.attr("data-type"),g=c.closest("form"),h=c.attr("name").replace(/\[customize\]$/,"[value]"),i=c.prop("checked")?e:d;if("text"===f){g.find("[name=\""+h+"\"]").val(i)}else if("date_selector"===f){g.find("[name=\""+h+"[day]\"]").val(i.day);g.find("[name=\""+h+"[month]\"]").val(i.month);g.find("[name=\""+h+"[year]\"]").val(i.year)}else if("date_time_selector"===f){g.find("[name=\""+h+"[day]\"]").val(i.day);g.find("[name=\""+h+"[month]\"]").val(i.month);g.find("[name=\""+h+"[year]\"]").val(i.year);g.find("[name=\""+h+"[hour]\"]").val(i.hour);g.find("[name=\""+h+"[minute]\"]").val(i.minute)}})});
|
|
//# sourceMappingURL=defaultcustom.min.js.map
|