6 Commits

Author SHA1 Message Date
Andrew Nicols
31d6adef4d MDL-70990 core_block: Replace legacy BLOCK_CONTENT_UPDATED event
The legacy M.core.event.BLOCK_CONTENT_UPDATED event has been replaced with a
new core_block/events::blockContentUpdated native DOM event.

The new event can be triggered using the `notifyBlockContentUpdated`
event, and by providing the HTMLElement that was updated, for example:

```
import {notifyBlockContentUpdated} from 'core_block/events';

const someHandler = e => {
    // ...
    const updatedBlock = e.target.closest('.block');
    notifyBlockContentUpdated(updatedBlock);
};
```

The new event can be listened to at any point in the DOM using the
following syntax:

```
import {eventTypes} from 'core_block/events';

const handler = e => {
    // The block that was updated.
    e.target;

    // The id of the updated block.
    e.detail.instanceId;
};

document.addEventListener(eventTypes.blockContentUpdated, handler);
```

A backward-compatabibility layer is included to ensure that any legacy
YUI event listener is still called with the same arguments.

This legacy bridges will be removed after Moodle 4.3.
2021-05-26 10:47:17 +08:00
Issam Taboubi
0aa65aefe7 MDL-71303 core: HTML not escaped in block skip link 2021-04-09 17:10:19 -04:00
Shamim Rezaie
768c318ad6 MDL-67969 lib: Fix duplicate blockinstanceid for fake blocks 2020-02-19 21:20:01 +11:00
zpottie
7a02f020c3 MDL-58315 core: Add support for custom block classes 2019-05-03 16:12:29 +12:00
Mathew May
5db1ce5331 MDL-64506 templates: BS2 pull-x -> BS4 float-x 2019-04-03 19:47:13 +08:00
Mathew May
b13a453d25 MDL-58428 theme: Move templates from lib 2019-02-26 12:56:14 +01:00