mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 07:24:13 +01:00
N°7552 - Fix regression from previous merge (f63abd9b)
Can't submit HTML field in the backoffice
This commit is contained in:
@@ -1,6 +1,12 @@
|
|||||||
import { Plugin } from '@ckeditor/ckeditor5-core';
|
import { Plugin } from '@ckeditor/ckeditor5-core';
|
||||||
import {ClassicEditor} from "@ckeditor/ckeditor5-editor-classic";
|
import {ClassicEditor} from "@ckeditor/ckeditor5-editor-classic";
|
||||||
|
|
||||||
|
interface BlockFieldInterface{
|
||||||
|
(element:HTMLElement, isBlocked: boolean):any;
|
||||||
|
}
|
||||||
|
|
||||||
|
declare var BlockFieldElement: BlockFieldInterface;
|
||||||
|
|
||||||
export default class Disabler extends Plugin {
|
export default class Disabler extends Plugin {
|
||||||
|
|
||||||
static get pluginName() {
|
static get pluginName() {
|
||||||
@@ -36,11 +42,7 @@ export default class Disabler extends Plugin {
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
const oElement = $(oEditor.ui.element);
|
const oElement = $(oEditor.ui.element);
|
||||||
if(typeof oElement.block === 'function') {
|
if(typeof oElement.block === 'function') {
|
||||||
if (oInputElement.disabled) {
|
BlockFieldElement(oElement, oInputElement.disabled);
|
||||||
oElement.block({message: '', blockMsgClass: '', enableValidation : true, baseZ: 9999, overlayCSS: { backgroundColor: '#ccd6e066'}});
|
|
||||||
} else {
|
|
||||||
oElement.unblock();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// handle ckeditor read only mode
|
// handle ckeditor read only mode
|
||||||
|
|||||||
@@ -314,6 +314,14 @@ function BlockField(field_id, bBlocked) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function BlockFieldElement(element, bBlocked) {
|
||||||
|
if (bBlocked) {
|
||||||
|
element.block({message: '', enableValidation : true, baseZ: 9999, overlayCSS: { backgroundColor: '#ccd6e066'}});
|
||||||
|
} else {
|
||||||
|
element.unblock();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Updates (enables/disables) a "duration" field
|
* Updates (enables/disables) a "duration" field
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user