Skip to content

Commit

Permalink
fix: Froala + Generic not setting GUI parameters. #KB-40561
Browse files Browse the repository at this point in the history
Taskid 40561
  • Loading branch information
carla-at-wiris authored and xripoll-at-wiris committed Dec 14, 2023
1 parent dd61e1c commit df98839
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ Last release of this project is was 22nd of November 2023.
- fix: Re-do action not working in TinyMCE 6 and Froala. #KB-39819
- fix: Error displayed when adding to the website the contents edited with an HTML editor if some text was added before some LaTeX code.
- fix: Drag & drop an inserted formula with brackets would change the brackets to parentheses. #KB-39549
- fix: Froala + Generic not setting GUI parameters. #KB-40561

### 8.6.0 2023-10-10

Expand Down
12 changes: 8 additions & 4 deletions packages/froala/wiris.src.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,24 +92,28 @@ export class FroalaIntegration extends IntegrationModel {

super.init();

// Create dynamic button id.
let mathTypeId = 'wirisEditor-' + editor.id;
let chemTypeId = 'wirisChemistry-' + editor.id;

// Hide MathType toolbar button if is disabled by config.
if (!Configuration.get('editorEnabled')) {
FroalaEditor.ICONS.wirisEditor = null;
FroalaEditor.COMMANDS.wirisEditor = null;
document.getElementById('wirisEditor-1').classList.add('fr-hidden');
document.getElementById(mathTypeId).classList.add('fr-hidden');
} else {
// Translate the button title
document.getElementById('wirisEditor-1').title = StringManager.get('insert_math', editor.opts.language);
document.getElementById(mathTypeId).title = StringManager.get('insert_math', editor.opts.language);
}

// Hide ChemType toolbar button if is disabled by config.
if (!Configuration.get('chemEnabled')) {
FroalaEditor.ICONS.wirisChemistry = null;
FroalaEditor.COMMANDS.wirisChemistry = null;
document.getElementById('wirisChemistry-1').classList.add('fr-hidden');
document.getElementById(chemTypeId).classList.add('fr-hidden');
} else {
// Translate the button title
document.getElementById('wirisChemistry-1').title = StringManager.get('insert_chem', editor.opts.language);
document.getElementById(chemTypeId).title = StringManager.get('insert_chem', editor.opts.language);
}
}

Expand Down

0 comments on commit df98839

Please sign in to comment.