mirror of
https://github.com/codex-team/editor.js
synced 2024-06-26 09:20:07 +02:00
Remove textarea, add holder
This commit is contained in:
parent
d581856d78
commit
16effa5f11
4
codex.js
4
codex.js
|
@ -40,7 +40,7 @@ module.exports = (function (editor) {
|
|||
*/
|
||||
editor.settings = {
|
||||
tools : ['paragraph', 'header', 'picture', 'list', 'quote', 'code', 'twitter', 'instagram', 'smile'],
|
||||
textareaId: 'codex-editor',
|
||||
holderId : 'codex-editor',
|
||||
|
||||
// Type of block showing on empty editor
|
||||
initialBlockPlugin: 'paragraph'
|
||||
|
@ -143,4 +143,4 @@ module.exports = (function (editor) {
|
|||
|
||||
return editor;
|
||||
|
||||
})({});
|
||||
})({});
|
||||
|
|
|
@ -39,11 +39,11 @@ module.exports = (function (core) {
|
|||
|
||||
editor.hideToolbar = userSettings.hideToolbar;
|
||||
|
||||
editor.nodes.textarea = document.getElementById(userSettings.textareaId || editor.settings.textareaId);
|
||||
editor.nodes.holder = document.getElementById(userSettings.holderId || editor.settings.holderId);
|
||||
|
||||
if (typeof editor.nodes.textarea === undefined || editor.nodes.textarea === null) {
|
||||
if (typeof editor.nodes.holder === undefined || editor.nodes.holder === null) {
|
||||
|
||||
reject(Error("Textarea wasn't found by ID: #" + userSettings.textareaId));
|
||||
reject(Error("Holder wasn't found by ID: #" + userSettings.holderId));
|
||||
|
||||
} else {
|
||||
|
||||
|
@ -293,4 +293,4 @@ module.exports = (function (core) {
|
|||
|
||||
return core;
|
||||
|
||||
})({});
|
||||
})({});
|
||||
|
|
|
@ -61,8 +61,8 @@ module.exports = (function (ui) {
|
|||
editor.nodes.wrapper = wrapper;
|
||||
editor.nodes.redactor = redactor;
|
||||
|
||||
/** Append editor wrapper with redactor zone after initial textarea */
|
||||
editor.core.insertAfter(editor.nodes.textarea, wrapper);
|
||||
/** Append editor wrapper with redactor zone into holder */
|
||||
editor.nodes.holder.appendChild(wrapper);
|
||||
|
||||
resolve();
|
||||
|
||||
|
@ -429,4 +429,4 @@ module.exports = (function (ui) {
|
|||
|
||||
return ui;
|
||||
|
||||
})({});
|
||||
})({});
|
||||
|
|
Loading…
Reference in a new issue