mirror of
https://github.com/codex-team/editor.js
synced 2026-03-17 16:10:07 +01:00
get tool improvements
This commit is contained in:
parent
17c65ead28
commit
99ec7b6455
6 changed files with 139 additions and 52 deletions
|
|
@ -61,7 +61,12 @@
|
|||
class Quote {
|
||||
|
||||
static prepare() {
|
||||
return Promise.resolve();
|
||||
return new Promise(function(resolve, reject) {
|
||||
|
||||
window.setTimeout(function() {
|
||||
resolve();
|
||||
}, 1000);
|
||||
});
|
||||
}
|
||||
|
||||
render() {
|
||||
|
|
@ -74,13 +79,22 @@
|
|||
|
||||
}
|
||||
|
||||
class AnotherTool {
|
||||
|
||||
static prepare() {
|
||||
return Promise.reject();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
codex = {};
|
||||
codex.editor = 1;
|
||||
var editor = new CodexEditor({
|
||||
holderId : 'codex-editor',
|
||||
inittialBlock : 'paragraph',
|
||||
tools: {
|
||||
quote: Quote
|
||||
quote: Quote,
|
||||
anotherTool : AnotherTool
|
||||
},
|
||||
toolsConfig: {
|
||||
quote: {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue