Skip to content
Snippets Groups Projects
Commit 51cd4ece authored by Janis Daniel Dähne's avatar Janis Daniel Dähne
Browse files

- fixed issue where font size was only applied to first file when printing editor files

parent cada6d46
No related branches found
No related tags found
No related merge requests found
......@@ -511,7 +511,7 @@ class MultiFileAceEditor extends React.Component<Props, any> {
}
innerHtml += markdown.render(markdownContent)
innerHtml += aceRenderedObj.html
innerHtml += `<div class="font-sized">${aceRenderedObj.html}</div>`
if (onePagePerFile === false) { //continuous text --> add new line after file
innerHtml += `<br />`
......@@ -538,19 +538,23 @@ class MultiFileAceEditor extends React.Component<Props, any> {
// tslint:disable-next-line
fontSize = Math.min(fontSize, 17) //everything above 17 will not work properly (lines intersect, tested)
// tslint:disable-next-line
fontSize = Math.max(fontSize, 10) //8 would work too but 12 is normal
fontSize = Math.max(fontSize, 8) //8 would work too but 12 is normal...
const editorStyleFontSize = document.createElement("style") as HTMLStyleElement
editorStyleFontSize.appendChild(document.createTextNode(`
#${tempPrintDivId} .font-sized .ace_static_highlight {
font-size: ${fontSize}px;
}
`))
document.head.appendChild(editorStyleFontSize)
PrintHelper.printContent(innerHtml,
() => {
const div = document.querySelector(
`#${tempPrintDivId} .ace_static_highlight`) as HTMLDivElement | null
//static renderer has hard coded fontsize...
if (!div) return
div.style.fontSize = `${fontSize}px`
},
() => {
document.head.removeChild(editorStyle)
document.head.removeChild(editorStyleFontSize)
}
)
......
......@@ -13,7 +13,7 @@ import Logger from './helpers/logger'
* y - breaking changes / new features
* z - fixes, small changes
*/
export const versionString = '2.5.7'
export const versionString = '2.5.8'
export const supportMail = 'yapex@informatik.uni-halle.de'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment