Skip to content

Commit fb9d1a6

Browse files
committed
Merge remote-tracking branch 'origin/1.0' into 1.x
2 parents ed428a9 + cf5dccd commit fb9d1a6

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

public/js/editor.js

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,16 @@ pimcore.bundle.tinymce.editor = Class.create({
2323
},
2424

2525
initializeWysiwyg: function (e) {
26+
2627
if (e.detail.context === 'object') {
2728
if (!isNaN(e.detail.config.maxCharacters) && e.detail.config.maxCharacters > 0) {
2829
this.maxChars = e.detail.config.maxCharacters;
29-
}else{
30+
} else {
3031
this.maxChars = -1;
3132
}
33+
e.detail.config = Object.assign({}, {ui_mode: 'combined'}, e.detail.config);
34+
} else {
35+
e.detail.config = Object.assign({}, {ui_mode: 'split'}, e.detail.config);
3236
}
3337

3438
this.config = e.detail.config;
@@ -59,7 +63,13 @@ pimcore.bundle.tinymce.editor = Class.create({
5963
language = {};
6064
}
6165

62-
const toolbar1 = 'undo redo | blocks | ' +
66+
let charCountPlugin = '';
67+
if (this.maxChars !== -1) {
68+
charCountPlugin = '| wordcount ';
69+
}
70+
71+
72+
const toolbar1 = `undo redo ${charCountPlugin} | blocks | ` +
6373
'bold italic | alignleft aligncenter ' +
6474
'alignright alignjustify | link hr charmap';
6575

@@ -114,7 +124,6 @@ pimcore.bundle.tinymce.editor = Class.create({
114124
],
115125
content_style: 'body { font-family:Helvetica,Arial,sans-serif; font-size:14px }',
116126
inline: true,
117-
ui_mode: 'split',
118127
base_url: '/bundles/pimcoretinymce/build/tinymce',
119128
suffix: '.min',
120129
convert_urls: false,

0 commit comments

Comments
 (0)