Merge pull request #200 from codex-team/placeholder2

Custom placeholder update
This commit is contained in:
Taly 2017-08-30 06:50:40 +03:00 committed by GitHub
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

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,

View file

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