mirror of
https://github.com/moodle/moodle.git
synced 2025-01-17 13:38:32 +01:00
MDL-81050 course: Fix section renaming in section page
Fix section page heading title update when the section name has been modified using inplace editable.
This commit is contained in:
parent
b73a685ef7
commit
34ab1582cb
2
course/amd/build/actions.min.js
vendored
2
course/amd/build/actions.min.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -994,7 +994,7 @@ define(
|
||||
|
||||
// The section and activity names are edited using inplace editable.
|
||||
// The "update" jQuery event must be captured in order to update the course state.
|
||||
$('body').on('updated', `${SELECTOR.SECTIONLI} ${SELECTOR.SECTIONITEM} [data-inplaceeditable]`, function(e) {
|
||||
$('body').on('updated', `${SELECTOR.SECTIONITEM} [data-inplaceeditable]`, function(e) {
|
||||
if (e.ajaxreturn && e.ajaxreturn.itemid) {
|
||||
const state = courseeditor.state;
|
||||
const section = state.section.get(e.ajaxreturn.itemid);
|
||||
|
@ -148,7 +148,10 @@ if ($format->show_editor()) {
|
||||
$renderable = $sectionclass->export_for_template($renderer);
|
||||
$controlmenuhtml = $renderable->controlmenu->menu;
|
||||
$PAGE->add_header_action($controlmenuhtml);
|
||||
$sectionheading = $OUTPUT->render($format->inplace_editable_render_section_name($sectioninfo, false));
|
||||
$sectionheading = $OUTPUT->container(
|
||||
$OUTPUT->render($format->inplace_editable_render_section_name($sectioninfo, false)),
|
||||
attributes: ['data-for' => 'section_title'],
|
||||
);
|
||||
$PAGE->set_heading($sectionheading, false, false);
|
||||
} else {
|
||||
$PAGE->set_heading($sectiontitle);
|
||||
|
Loading…
x
Reference in New Issue
Block a user