editor.settings.placeholder

This commit is contained in:
Taly Guryn 2017-08-30 06:48:52 +03:00
parent 73ebe4162f
commit dfdaba6bb1
5 changed files with 7 additions and 7 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -60,6 +60,7 @@
codex.editor.start({
holderId : "codex-editor",
initialBlockPlugin : 'paragraph',
// placeholder: 'Прошлой ночью мне приснилось...',
hideToolbar: false,
tools : {
paragraph: {
@ -222,7 +223,6 @@
},
data : {
id: +new Date(),
placeholder: 'Прошлой ночью мне приснилось...',
items: [
{
type : 'header',

View file

@ -45,6 +45,8 @@ module.exports = (function (core) {
editor.hideToolbar = userSettings.hideToolbar;
editor.settings.placeholder = userSettings.placeholder || '';
editor.nodes.holder = document.getElementById(userSettings.holderId || editor.settings.holderId);
if (typeof editor.nodes.holder === undefined || editor.nodes.holder === null) {

View file

@ -405,9 +405,7 @@ module.exports = (function (ui) {
initialBlock = editor.tools[initialBlockType].render();
let initialBlockPlaceholder = editor.state.blocks.placeholder || '';
initialBlock.setAttribute('data-placeholder', initialBlockPlaceholder);
initialBlock.setAttribute('data-placeholder', editor.settings.placeholder);
editor.content.insertBlock({
type : initialBlockType,