mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-24 02:58:43 +02:00
N°5298 -When opening CKEditor4 data with CKEditor5, if no change has been made return initial data instead of transformed data
This commit is contained in:
@@ -173,14 +173,17 @@ EOF
|
||||
|
||||
// Some additional stuff if we are displaying it with a rich editor
|
||||
if ($bRichEditor) {
|
||||
$aConfig = CKEditorHelper::GetCkeditorPref();
|
||||
$aConfig['extraPlugins'] = 'codesnippet';
|
||||
// TODO 3.2.0 How to get a config for portal without mentions ?
|
||||
// $aConfig = CKEditorHelper::GetCkeditorPref();
|
||||
$aConfig = [];
|
||||
$aConfig['detectChanges'] = ['initialValue' => $this->oField->GetCurrentValue()];
|
||||
|
||||
$sJsConfig = json_encode($aConfig);
|
||||
|
||||
$oOutput->AddJs(
|
||||
<<<JS
|
||||
$('#{$this->oField->GetGlobalId()}').addClass('htmlEditor');
|
||||
CombodoCKEditorHandler.CreateInstance('#{$this->oField->GetGlobalId()}').then(( oEditor) => {
|
||||
CombodoCKEditorHandler.CreateInstance('#{$this->oField->GetGlobalId()}', $sJsConfig).then(( oEditor) => {
|
||||
oEditor.model.document.on('change:data', (event) => {
|
||||
|
||||
$('#{$this->oField->GetGlobalId()}').val(oEditor.getData()).trigger("change");
|
||||
|
||||
Reference in New Issue
Block a user