mirror of
https://github.com/codex-team/editor.js
synced 2024-05-10 10:26:46 +02:00
editor.settings.placeholder
This commit is contained in:
parent
73ebe4162f
commit
dfdaba6bb1
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -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',
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue