Skip to content

Commit

Permalink
adds toolbar items
Browse files Browse the repository at this point in the history
  • Loading branch information
riniculous committed Aug 20, 2020
1 parent e4687f7 commit 898fd38
Showing 1 changed file with 29 additions and 1 deletion.
30 changes: 29 additions & 1 deletion src/Field.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,35 @@ public function getInputHtml($value, ElementInterface $element = null): string
$js = <<<JS
ClassicEditor
.create(document.getElementById('{$nsId}'))
.create(document.getElementById('{$nsId}'), {
"toolbar": {
"items": ['heading',
'|',
'bold',
'italic',
'link',
'bulletedList',
'numberedList',
'|',
'indent',
'outdent',
'|',
'imageUpload',
'blockQuote',
'insertTable',
'mediaEmbed',
'undo',
'redo',
'codeBlock',
'code']
},
"image": {
"toolbar": ["imageStyle:full", "imageStyle:side", "|", "imageTextAlternative"]
},
"table": {
"contentToolbar": ["tableColumn", "tableRow", "mergeTableCells"]
},
"language": "en"})
.then(function(editor) {
$(editor.element).closest('form').on('submit', function() {
editor.updateSourceElement();
Expand Down

0 comments on commit 898fd38

Please sign in to comment.