diff --git a/resources/assets/javascripts/bootstrap/wysiwyg.js b/resources/assets/javascripts/bootstrap/wysiwyg.js index 60b4251bf113905794d791b55e0c129673eef6d8..39eaa713c581eaba7fa82763f650b612015b083b 100644 --- a/resources/assets/javascripts/bootstrap/wysiwyg.js +++ b/resources/assets/javascripts/bootstrap/wysiwyg.js @@ -3,6 +3,15 @@ STUDIP.domReady(() => { // replace areas visible on page load replaceVisibleTextareas(); + // update the height of the editor view on focus changes in dialogs + $(document).on('focus blur', '.studip-dialog .ck-editor__editable_inline', function(event) { + let height = this.clientHeight; + let editor = this.ckeditorInstance; + editor.editing.view.change(writer => { + writer.setStyle('height', height + 'px', editor.editing.view.document.getRoot()); + }); + }); + // replace areas that are created or shown after page load // remove editors that become hidden after page load // show, hide and create do not raise an event, use interval timer diff --git a/resources/assets/stylesheets/scss/studip-cke-ui.scss b/resources/assets/stylesheets/scss/studip-cke-ui.scss index 65a29555276cfa1c6c0308948445fa9a1c61a4b2..d2b52b149e696ab60042015179718bde62dc7b71 100644 --- a/resources/assets/stylesheets/scss/studip-cke-ui.scss +++ b/resources/assets/stylesheets/scss/studip-cke-ui.scss @@ -400,8 +400,9 @@ form.default .ck-source-editing-area textarea { .studip-dialog { .ck-editor { overflow: hidden; - .ck.ck-editor__main > .ck-editor__editable { + .ck-editor__editable_inline { height: 200px; + resize: vertical; } } }