From d9c8abe53c4562d1df9a04b95a7ee46b106ba7e8 Mon Sep 17 00:00:00 2001 From: Andrew Nicols Date: Tue, 12 Nov 2024 11:30:10 +0800 Subject: [PATCH] [docs] Update inplace editable docs with update events --- docs/apis/subsystems/output/inplace.md | 6 +++--- .../version-4.3/apis/subsystems/output/inplace.md | 6 +++--- .../version-4.4/apis/subsystems/output/inplace.md | 6 +++--- .../version-4.5/apis/subsystems/output/inplace.md | 6 +++--- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/docs/apis/subsystems/output/inplace.md b/docs/apis/subsystems/output/inplace.md index 835d05f8e..9ab086c59 100644 --- a/docs/apis/subsystems/output/inplace.md +++ b/docs/apis/subsystems/output/inplace.md @@ -324,8 +324,8 @@ Plugin page can listen to JQuery events that are triggered on successful update ```php $PAGE->requires->js_amd_inline(" -require(['jquery'], function(\$) { - $('body').on('event:core/inplace_editable:updateFailed', '[data-inplaceeditable]', (e) => { +require(['jquery', 'core/local/inplace_editable/events'], function(\$, Events) { + $('body').on(Events.eventTypes.elementUpdateFailed, '[data-inplaceeditable]', (e) => { // The exception object returned by the callback. const exception = e.exception; @@ -337,7 +337,7 @@ require(['jquery'], function(\$) { // Do your own error processing here. }); - $('body').on('core/inplace_editable:updated', '[data-inplaceeditable]', (e) => { + $('body').on(Events.eventTypes.elementUpdated, '[data-inplaceeditable]', (e) => { // Everything that web service returned. const ajaxreturn = e.ajaxreturn; diff --git a/versioned_docs/version-4.3/apis/subsystems/output/inplace.md b/versioned_docs/version-4.3/apis/subsystems/output/inplace.md index 835d05f8e..9ab086c59 100644 --- a/versioned_docs/version-4.3/apis/subsystems/output/inplace.md +++ b/versioned_docs/version-4.3/apis/subsystems/output/inplace.md @@ -324,8 +324,8 @@ Plugin page can listen to JQuery events that are triggered on successful update ```php $PAGE->requires->js_amd_inline(" -require(['jquery'], function(\$) { - $('body').on('event:core/inplace_editable:updateFailed', '[data-inplaceeditable]', (e) => { +require(['jquery', 'core/local/inplace_editable/events'], function(\$, Events) { + $('body').on(Events.eventTypes.elementUpdateFailed, '[data-inplaceeditable]', (e) => { // The exception object returned by the callback. const exception = e.exception; @@ -337,7 +337,7 @@ require(['jquery'], function(\$) { // Do your own error processing here. }); - $('body').on('core/inplace_editable:updated', '[data-inplaceeditable]', (e) => { + $('body').on(Events.eventTypes.elementUpdated, '[data-inplaceeditable]', (e) => { // Everything that web service returned. const ajaxreturn = e.ajaxreturn; diff --git a/versioned_docs/version-4.4/apis/subsystems/output/inplace.md b/versioned_docs/version-4.4/apis/subsystems/output/inplace.md index 835d05f8e..9ab086c59 100644 --- a/versioned_docs/version-4.4/apis/subsystems/output/inplace.md +++ b/versioned_docs/version-4.4/apis/subsystems/output/inplace.md @@ -324,8 +324,8 @@ Plugin page can listen to JQuery events that are triggered on successful update ```php $PAGE->requires->js_amd_inline(" -require(['jquery'], function(\$) { - $('body').on('event:core/inplace_editable:updateFailed', '[data-inplaceeditable]', (e) => { +require(['jquery', 'core/local/inplace_editable/events'], function(\$, Events) { + $('body').on(Events.eventTypes.elementUpdateFailed, '[data-inplaceeditable]', (e) => { // The exception object returned by the callback. const exception = e.exception; @@ -337,7 +337,7 @@ require(['jquery'], function(\$) { // Do your own error processing here. }); - $('body').on('core/inplace_editable:updated', '[data-inplaceeditable]', (e) => { + $('body').on(Events.eventTypes.elementUpdated, '[data-inplaceeditable]', (e) => { // Everything that web service returned. const ajaxreturn = e.ajaxreturn; diff --git a/versioned_docs/version-4.5/apis/subsystems/output/inplace.md b/versioned_docs/version-4.5/apis/subsystems/output/inplace.md index 835d05f8e..9ab086c59 100644 --- a/versioned_docs/version-4.5/apis/subsystems/output/inplace.md +++ b/versioned_docs/version-4.5/apis/subsystems/output/inplace.md @@ -324,8 +324,8 @@ Plugin page can listen to JQuery events that are triggered on successful update ```php $PAGE->requires->js_amd_inline(" -require(['jquery'], function(\$) { - $('body').on('event:core/inplace_editable:updateFailed', '[data-inplaceeditable]', (e) => { +require(['jquery', 'core/local/inplace_editable/events'], function(\$, Events) { + $('body').on(Events.eventTypes.elementUpdateFailed, '[data-inplaceeditable]', (e) => { // The exception object returned by the callback. const exception = e.exception; @@ -337,7 +337,7 @@ require(['jquery'], function(\$) { // Do your own error processing here. }); - $('body').on('core/inplace_editable:updated', '[data-inplaceeditable]', (e) => { + $('body').on(Events.eventTypes.elementUpdated, '[data-inplaceeditable]', (e) => { // Everything that web service returned. const ajaxreturn = e.ajaxreturn;