This commit is contained in:
Murod Khaydarov 2018-06-23 23:51:34 +03:00
commit c85f9d0d00
No known key found for this signature in database
GPG key ID: C480BA53A8D274C5
2 changed files with 31 additions and 4 deletions

View file

@ -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

View file

@ -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();
}
}
```