MDL-77712 core_course: Fix exception with inplace editor
* On fresh install, an exception is raised when we try to modify the name of a newly inserted activity in the front page
This commit is contained in:
committed by
Laurent David
parent
a78f3a02c6
commit
fbbdfefdb6
Vendored
+1
-1
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -82,6 +82,7 @@ define(
|
||||
TOGGLE: '.toggle-display,.dropdown-toggle',
|
||||
SECTIONLI: 'li.section',
|
||||
SECTIONACTIONMENU: '.section_action_menu',
|
||||
SECTIONITEM: '[data-for="section_title"]',
|
||||
ADDSECTIONS: '.changenumsections [data-add-sections]',
|
||||
SECTIONBADGES: '[data-region="sectionbadges"]',
|
||||
};
|
||||
@@ -981,7 +982,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} [data-inplaceeditable]`, function(e) {
|
||||
$('body').on('updated', `${SELECTOR.SECTIONLI} ${SELECTOR.SECTIONITEM} [data-inplaceeditable]`, function(e) {
|
||||
if (e.ajaxreturn && e.ajaxreturn.itemid) {
|
||||
const state = courseeditor.state;
|
||||
const section = state.section.get(e.ajaxreturn.itemid);
|
||||
|
||||
Reference in New Issue
Block a user