Commit b6c52394 authored by Carsten  Rose's avatar Carsten Rose
Browse files

Merge remote-tracking branch 'origin/b7974-tinyMCE' into develop

parents 102af1d6 d3c58318
Pipeline #2873 passed with stages
in 3 minutes and 28 seconds
......@@ -1178,6 +1178,7 @@ abstract class AbstractBuildForm {
$json[API_ELEMENT_UPDATE][$key][API_ELEMENT_ATTRIBUTE]['class'] = $class;
$json[API_ELEMENT_UPDATE][$key][API_ELEMENT_ATTRIBUTE]['required'] = ($formElement[FE_MODE] == 'required');
$json[API_ELEMENT_UPDATE][$key][API_ELEMENT_ATTRIBUTE]['hidden'] = $statusHidden;
$json[API_ELEMENT_UPDATE][$key][API_ELEMENT_ATTRIBUTE]['readonly'] = $json['disabled'] ? 'readonly' : 'false';
if ($pattern !== null) {
$json[API_ELEMENT_UPDATE][$key][API_ELEMENT_ATTRIBUTE]['pattern'] = $pattern;
......
......@@ -68,21 +68,23 @@ QfqNS.Helper = QfqNS.Helper || {};
});
/* Remove ReadOnly Again - we have to implement tinymce differently
to make it easier to change such attributes */
to make it easier to change such */
var me = editor;
var $parent = $(config.selector);
$parent.parent('div').mouseenter(function(e) {
if($parent.is('[readonly="readonly"]')) {
$parent.on("blur", function(e, configuration) {
if(configuration.disabled || configuration.readonly) {
me.setMode("readonly");
$(this).siblings(".mce-tinymce").addClass("qfq-tinymce-readonly");
} else {
me.setMode("design");
$(this).siblings(".mce-tinymce").removeClass("qfq-tinymce-readonly");
}
});
};
tinymce.init(config);
if($(this).is('[readonly]')) {
if($(this).is('[disabled]')) {
myEditor.setMode("readonly");
}
}
......
......@@ -1231,6 +1231,14 @@ var QfqNS = QfqNS || {};
try {
var element = n.Element.getElement(formElementName);
// Cleaner way to set states for tinymce
// This triggers the event on the unaccesable textarea
// The tinymce registers a listener on the textarea
// See helper/tinyMCE.js for details
if(element.$element.hasClass('qfq-tinymce')) {
element.$element.trigger("blur", [configurationItem]);
}
if (configurationItem.value !== undefined) {
element.setValue(configurationItem.value);
}
......
......@@ -355,6 +355,10 @@ i.@{spinner_class} {
/* ERROR END */
.qfq-tinymce-readonly .mce-panel {
background-color: #eee;
}
/* inline elements in horizontal mode are too much left */
.form-horizontal {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment