Skip to content

Commit

Permalink
Merge pull request #88 from mostafaznv/dev
Browse files Browse the repository at this point in the history
fix: source editing button causes disappearing editor
  • Loading branch information
mostafaznv authored Oct 25, 2023
2 parents 57e688a + acf3c2f commit 9946931
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 10 deletions.
2 changes: 1 addition & 1 deletion dist/js/field.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"@ckeditor/ckeditor5-basic-styles": "^40.0.0",
"@ckeditor/ckeditor5-block-quote": "^40.0.0",
"@ckeditor/ckeditor5-code-block": "^40.0.0",
"@ckeditor/ckeditor5-dev-utils": "^39.1.0",
"@ckeditor/ckeditor5-dev-utils": "^39.2.0",
"@ckeditor/ckeditor5-dev-webpack-plugin": "^31.1.13",
"@ckeditor/ckeditor5-editor-classic": "^40.0.0",
"@ckeditor/ckeditor5-essentials": "^40.0.0",
Expand Down
11 changes: 3 additions & 8 deletions resources/js/components/editor-field.vue
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,6 @@ export default {
priority: 'lowest'
})
// set the height of the editor when editing
if (this.currentField.height > 1) {
editor.editing.view.change(writer => {
writer.setStyle('height', `${this.currentField.height}px`, editor.editing.view.document.getRoot());
});
}
editor.editing.view.change((writer) => {
// set the height of the editor when editing
if (this.currentField.height > 1) {
Expand Down Expand Up @@ -254,7 +247,9 @@ export default {
debounce((element) => {
const height = element[0].target.offsetHeight
writer.setStyle('height', `${height}px`, editor.editing.view.document.getRoot())
if (height > 10) {
writer.setStyle('height', `${height}px`, editor.editing.view.document.getRoot())
}
}, 100),
)
Expand Down

0 comments on commit 9946931

Please sign in to comment.