Merge pull request #199 from codex-team/placeholder

Add custom placeholder
This commit is contained in:
Taly 2017-08-30 06:38:36 +03:00 committed by GitHub
commit 73ebe4162f
5 changed files with 8 additions and 12 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

@ -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
}

View file

@ -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,

View file

@ -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": {