Skip to content

Commit

Permalink
[docs] Update inplace editable docs with update events
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewnicols committed Nov 12, 2024
1 parent d6ede5f commit d9c8abe
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions docs/apis/subsystems/output/inplace.md
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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;

Expand Down
6 changes: 3 additions & 3 deletions versioned_docs/version-4.3/apis/subsystems/output/inplace.md
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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;

Expand Down
6 changes: 3 additions & 3 deletions versioned_docs/version-4.4/apis/subsystems/output/inplace.md
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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;

Expand Down
6 changes: 3 additions & 3 deletions versioned_docs/version-4.5/apis/subsystems/output/inplace.md
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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;

Expand Down

0 comments on commit d9c8abe

Please sign in to comment.