Merge branch 'MDL-78607-master' of https://github.com/roland04/moodle

This commit is contained in:
Huong Nguyen 2023-09-13 14:46:35 +07:00
commit 8dece72737
No known key found for this signature in database
GPG Key ID: 40D88AB693A3E72A
6 changed files with 26 additions and 9 deletions

View File

@ -146,9 +146,10 @@ M.core_availability.form = {
this.updateRestrictByGroup();
}
// Everything is ready. Make sure the div is visible.
// Everything is ready. Make sure the div is visible and hide the loading indicator.
this.parent = Y.one('#fitem_id_availabilityconditionsjson');
this.parent.removeClass('d-none');
document.getElementById('availabilityconditions-loading').remove();
},
/**

File diff suppressed because one or more lines are too long

View File

@ -146,9 +146,10 @@ M.core_availability.form = {
this.updateRestrictByGroup();
}
// Everything is ready. Make sure the div is visible.
// Everything is ready. Make sure the div is visible and hide the loading indicator.
this.parent = Y.one('#fitem_id_availabilityconditionsjson');
this.parent.removeClass('d-none');
document.getElementById('availabilityconditions-loading').remove();
},
/**

View File

@ -144,9 +144,10 @@ M.core_availability.form = {
this.updateRestrictByGroup();
}
// Everything is ready. Make sure the div is visible.
// Everything is ready. Make sure the div is visible and hide the loading indicator.
this.parent = Y.one('#fitem_id_availabilityconditionsjson');
this.parent.removeClass('d-none');
document.getElementById('availabilityconditions-loading').remove();
},
/**

View File

@ -17,7 +17,7 @@ require_once($CFG->libdir.'/gradelib.php');
class editsection_form extends moodleform {
function definition() {
global $CFG;
global $CFG, $OUTPUT;
$mform = $this->_form;
$course = $this->_customdata['course'];
@ -60,6 +60,13 @@ class editsection_form extends moodleform {
get_string('accessrestrictions', 'availability'),
['class' => 'd-none']
);
// Availability loading indicator.
$loadingcontainer = $OUTPUT->container(
$OUTPUT->render_from_template('core/loading', []),
'd-flex justify-content-center py-5 icon-size-5',
'availabilityconditions-loading'
);
$mform->addElement('html', $loadingcontainer);
}
$mform->_registerCancelButton('cancel');

View File

@ -506,7 +506,7 @@ abstract class moodleform_mod extends moodleform {
* Adds all the standard elements to a form to edit the settings for an activity module.
*/
protected function standard_coursemodule_elements() {
global $COURSE, $CFG, $DB;
global $COURSE, $CFG, $DB, $OUTPUT;
$mform =& $this->_form;
$this->_outcomesused = false;
@ -629,6 +629,13 @@ abstract class moodleform_mod extends moodleform {
get_string('accessrestrictions', 'availability'),
['class' => 'd-none']
);
// Availability loading indicator.
$loadingcontainer = $OUTPUT->container(
$OUTPUT->render_from_template('core/loading', []),
'd-flex justify-content-center py-5 icon-size-5',
'availabilityconditions-loading'
);
$mform->addElement('html', $loadingcontainer);
// The _cm variable may not be a proper cm_info, so get one from modinfo.
if ($this->_cm) {