mirror of
https://github.com/codex-team/editor.js
synced 2026-03-16 07:35:48 +01:00
update
This commit is contained in:
parent
9d59e9c188
commit
c85f9d0d00
2 changed files with 31 additions and 4 deletions
|
|
@ -18,9 +18,9 @@ export interface IAPI {
|
|||
|
||||
#### IBlocksAPI
|
||||
|
||||
```moveDown()``` - method moves down the working block.
|
||||
```moveDown()``` - method moves down the current block.
|
||||
|
||||
```moveUp()``` - method moves up the working block.
|
||||
```moveUp()``` - method moves up the current block.
|
||||
|
||||
#### ISanitizerAPI
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
# CodeX Editor Toolbar Settings Module
|
||||
# CodeX Editor Toolbar Block Settings Module
|
||||
|
||||
Toolbar Module has space for Block settings. Settings divided into:
|
||||
- space for plugin's settings, that is described by «Plugin»'s Developer
|
||||
|
|
@ -33,7 +33,7 @@ Your Tune's constructor gets argument as object and it includes:
|
|||
- {Object} settings - settings contains block default state.
|
||||
This object could have information about cover, anchor and so on.
|
||||
|
||||
Example:
|
||||
Example on TypeScript:
|
||||
|
||||
```js
|
||||
|
||||
|
|
@ -62,3 +62,30 @@ export default class YourCustomTune implements IBlockTune {
|
|||
}
|
||||
}
|
||||
```
|
||||
|
||||
Example on ES6
|
||||
|
||||
```js
|
||||
export default class YourCustomTune {
|
||||
|
||||
constructor({api, settings}) {
|
||||
this.api = api;
|
||||
this.settings = settings;
|
||||
}
|
||||
|
||||
render() {
|
||||
let someHTML = '...';
|
||||
return someHTML;
|
||||
}
|
||||
|
||||
save() {
|
||||
// Return the important data that needs to be saved
|
||||
return object
|
||||
}
|
||||
|
||||
someMethod() {
|
||||
// moves current block down
|
||||
this.api.blocks.moveDown();
|
||||
}
|
||||
}
|
||||
```
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue