Remove textarea, add holder

This commit is contained in:
Taly Guryn 2017-03-15 17:03:24 +03:00
parent d581856d78
commit 16effa5f11
3 changed files with 9 additions and 9 deletions

View file

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

View file

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

View file

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