Skip to content
Snippets Groups Projects
Commit 2733d692 authored by Ron Lucke's avatar Ron Lucke Committed by Jan-Hendrik Willms
Browse files

fix #2499

Closes #2499

Merge request studip/studip!1710
parent ba7aae64
No related branches found
No related tags found
No related merge requests found
Pipeline #11974 passed
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
<section class="formatted-content" v-html="currentText" ref="content"></section> <section class="formatted-content" v-html="currentText" ref="content"></section>
</template> </template>
<template v-if="canEdit" #edit> <template v-if="canEdit" #edit>
<ckeditor :editor="editor" v-model="currentText" :config="editorConfig"></ckeditor> <ckeditor :editor="editor" v-model="currentText" :config="editorConfig" @ready="onReady"></ckeditor>
</template> </template>
<template #info><translate>Informationen zum Text-Block</translate></template> <template #info><translate>Informationen zum Text-Block</translate></template>
</courseware-default-block> </courseware-default-block>
...@@ -51,6 +51,18 @@ export default { ...@@ -51,6 +51,18 @@ export default {
text() { text() {
return this.block?.attributes?.payload?.text; return this.block?.attributes?.payload?.text;
}, },
ckeToolbarTop() {
const topBar = document.getElementById('top-bar');
const responsiveContentbar = document.getElementById('responsive-contentbar');
let top = topBar.clientHeight + topBar.clientTop;
if (responsiveContentbar) {
top += responsiveContentbar?.clientHeight + responsiveContentbar?.clientTop;
} else {
top += 85;
}
return top;
},
}, },
mounted() { mounted() {
this.initCurrent(); this.initCurrent();
...@@ -63,6 +75,10 @@ export default { ...@@ -63,6 +75,10 @@ export default {
this.currentText = this.text; this.currentText = this.text;
this.loadMathjax(); this.loadMathjax();
}, },
onReady( editor ) {
editor.ui.viewportOffset = { top: this.ckeToolbarTop };
editor.ui.update();
},
async storeText() { async storeText() {
let attributes = this.block.attributes; let attributes = this.block.attributes;
attributes.payload.text = this.currentText; attributes.payload.text = this.currentText;
...@@ -91,7 +107,7 @@ export default { ...@@ -91,7 +107,7 @@ export default {
.catch(() => { .catch(() => {
console.log('Warning: Could not load MathJax.'); console.log('Warning: Could not load MathJax.');
}); });
} },
}, }
}; };
</script> </script>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment