Compare commits

...

2 Commits

Author SHA1 Message Date
jf-cbd
29d2e5d5e7 Remove balloon remaining in full screen (on Firefox) 2024-06-10 16:11:49 +02:00
jf-cbd
a3386f0695 Dev command to improve development 2024-06-10 15:00:40 +02:00
2 changed files with 5 additions and 0 deletions

View File

@@ -53,6 +53,7 @@
"scripts": {
"styles": "cp -r src/resources/styles/ build/styles",
"build": "webpack --mode production && npm run styles",
"dev": "webpack --mode development --watch && npm run styles",
"postbuild": "tsc --declaration --declarationDir build --stripInternal --emitDeclarationOnly"
}
}

View File

@@ -34,17 +34,21 @@ export default class Maximize extends Plugin {
this.listenTo( oButton, 'execute', () => {
if(oEditor.ui.element !== null){
let CKEditorPoweredButton = document.getElementsByClassName('ck-powered-by-balloon');
if(oButton.isOn){
oInitialParentElement.append(oEditor.ui.element);
oEditor.ui.element.classList.remove('cke-maximized');
document.body.classList.remove('cke-maximized');
oButton.icon = sMaximizeIconSVG;
CKEditorPoweredButton.item(0)?.setAttribute('style', 'display: block');
}
else{
oInitialParentElement = oEditor.ui.element.parentElement ?? oInitialParentElement;
oEditor.ui.element.remove();
document.body.append(oEditor.ui.element);
document.body.classList.add('cke-maximized'); // Add class to body to prevent scrollbars
// Same behaviour between Chrome and Firefox (Firefox has a bug with the balloon remaning visible in the middle of the screen when the editor is maximized)
CKEditorPoweredButton.item(0)?.setAttribute('style', 'display: none');
oEditor.ui.element.classList.add('cke-maximized');
oButton.icon = sMinimizeIconSVG;
}