mirror of
https://github.com/codex-team/editor.js
synced 2024-06-01 21:42:26 +02:00
parent
8398f825a8
commit
953949e56f
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "codex.editor",
|
||||
"version": "2.5.3",
|
||||
"version": "2.5.4",
|
||||
"description": "Codex Editor. Native JS, based on API and Open Source",
|
||||
"main": "build/codex-editor.js",
|
||||
"types": "./types/index.d.ts",
|
||||
|
|
|
@ -101,13 +101,25 @@ export default class Core {
|
|||
set configuration(config: EditorConfig|string) {
|
||||
/**
|
||||
* Process zero-configuration or with only holderId
|
||||
* Make config object
|
||||
*/
|
||||
if (typeof config === 'string' || typeof config === 'undefined') {
|
||||
this.config = {
|
||||
holderId: config || 'codex-editor',
|
||||
if (typeof config !== 'object') {
|
||||
config = {
|
||||
holderId: config,
|
||||
};
|
||||
} else {
|
||||
this.config = config;
|
||||
}
|
||||
|
||||
/**
|
||||
* Place config into the class property
|
||||
* @type {EditorConfig}
|
||||
*/
|
||||
this.config = config;
|
||||
|
||||
/**
|
||||
* If holderId is empty then set a default value
|
||||
*/
|
||||
if (!this.config.holderId || typeof this.config.holderId !== 'string') {
|
||||
this.config.holderId = 'codex-editor';
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
2
types/configs/editor-config.d.ts
vendored
2
types/configs/editor-config.d.ts
vendored
|
@ -6,7 +6,7 @@ export interface EditorConfig {
|
|||
/**
|
||||
* Element where Editor will be append
|
||||
*/
|
||||
holderId: string;
|
||||
holderId?: string;
|
||||
|
||||
/**
|
||||
* This Tool will be used as default
|
||||
|
|
Loading…
Reference in a new issue