mirror of
https://github.com/moodle/moodle.git
synced 2025-01-17 13:38:32 +01:00
MDL-78288 core_course: Hide access restrictions textarea till ready
This commit is contained in:
parent
6c1471c755
commit
841d552942
@ -145,6 +145,10 @@ M.core_availability.form = {
|
||||
}
|
||||
this.updateRestrictByGroup();
|
||||
}
|
||||
|
||||
// Everything is ready. Make sure the div is visible.
|
||||
this.parent = Y.one('#fitem_id_availabilityconditionsjson');
|
||||
this.parent.removeClass('d-none');
|
||||
},
|
||||
|
||||
/**
|
||||
|
File diff suppressed because one or more lines are too long
@ -145,6 +145,10 @@ M.core_availability.form = {
|
||||
}
|
||||
this.updateRestrictByGroup();
|
||||
}
|
||||
|
||||
// Everything is ready. Make sure the div is visible.
|
||||
this.parent = Y.one('#fitem_id_availabilityconditionsjson');
|
||||
this.parent.removeClass('d-none');
|
||||
},
|
||||
|
||||
/**
|
||||
|
4
availability/yui/src/form/js/form.js
vendored
4
availability/yui/src/form/js/form.js
vendored
@ -143,6 +143,10 @@ M.core_availability.form = {
|
||||
}
|
||||
this.updateRestrictByGroup();
|
||||
}
|
||||
|
||||
// Everything is ready. Make sure the div is visible.
|
||||
this.parent = Y.one('#fitem_id_availabilityconditionsjson');
|
||||
this.parent.removeClass('d-none');
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -57,7 +57,9 @@ class editsection_form extends moodleform {
|
||||
// interaction is all implemented in JavaScript. The field is named
|
||||
// availabilityconditionsjson for consistency with moodleform_mod.
|
||||
$mform->addElement('textarea', 'availabilityconditionsjson',
|
||||
get_string('accessrestrictions', 'availability'));
|
||||
get_string('accessrestrictions', 'availability'),
|
||||
['class' => 'd-none']
|
||||
);
|
||||
}
|
||||
|
||||
$mform->_registerCancelButton('cancel');
|
||||
|
@ -712,7 +712,10 @@ abstract class moodleform_mod extends moodleform {
|
||||
// conflicts with fields in existing modules (such as assign).
|
||||
// So it uses a long name that will not conflict.
|
||||
$mform->addElement('textarea', 'availabilityconditionsjson',
|
||||
get_string('accessrestrictions', 'availability'));
|
||||
get_string('accessrestrictions', 'availability'),
|
||||
['class' => 'd-none']
|
||||
);
|
||||
|
||||
// The _cm variable may not be a proper cm_info, so get one from modinfo.
|
||||
if ($this->_cm) {
|
||||
$modinfo = get_fast_modinfo($COURSE);
|
||||
|
Loading…
x
Reference in New Issue
Block a user