mirror of
https://github.com/codex-team/editor.js
synced 2024-06-01 21:42:26 +02:00
Merge pull request #199 from codex-team/placeholder
Add custom placeholder
This commit is contained in:
commit
73ebe4162f
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
10
example.html
10
example.html
|
@ -222,9 +222,10 @@
|
|||
},
|
||||
data : {
|
||||
id: +new Date(),
|
||||
placeholder: 'Прошлой ночью мне приснилось...',
|
||||
items: [
|
||||
{
|
||||
type : 'paragraph',
|
||||
type : 'header',
|
||||
data : {
|
||||
text : 'Привет от CodeX'
|
||||
}
|
||||
|
@ -235,13 +236,6 @@
|
|||
text : 'Пишите нам на team@ifmo.su'
|
||||
}
|
||||
},
|
||||
{
|
||||
type : 'list',
|
||||
data : {
|
||||
type : 'OL',
|
||||
items : [1,3,4]
|
||||
}
|
||||
}
|
||||
],
|
||||
count: 3
|
||||
}
|
||||
|
|
|
@ -405,7 +405,9 @@ module.exports = (function (ui) {
|
|||
|
||||
initialBlock = editor.tools[initialBlockType].render();
|
||||
|
||||
initialBlock.setAttribute('data-placeholder', 'Расскажите свою историю...');
|
||||
let initialBlockPlaceholder = editor.state.blocks.placeholder || '';
|
||||
|
||||
initialBlock.setAttribute('data-placeholder', initialBlockPlaceholder);
|
||||
|
||||
editor.content.insertBlock({
|
||||
type : initialBlockType,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "codex.editor",
|
||||
"version": "1.7.3",
|
||||
"version": "1.7.4",
|
||||
"description": "Codex Editor. Native JS, based on API and Open Source",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
|
|
Loading…
Reference in a new issue