mirror of
https://github.com/codex-team/editor.js
synced 2026-03-16 15:45:47 +01:00
Merge pull request #200 from codex-team/placeholder2
Custom placeholder update
This commit is contained in:
commit
80b63fa18a
6 changed files with 8 additions and 8 deletions
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,
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "codex.editor",
|
||||
"version": "1.7.4",
|
||||
"version": "1.7.5",
|
||||
"description": "Codex Editor. Native JS, based on API and Open Source",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue