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

Merge remote-tracking branch 'origin/B9734-dirtyLockRelease' into B9720CheckboxVariousSetups

# Conflicts:
#	extension/Classes/Core/AbstractBuildForm.php
parents 99b9b9cc 9e078315
......@@ -249,6 +249,7 @@ class Support {
* @param bool $flagOmitEmpty true|false
* @param string $modeEscape ESCAPE_WITH_BACKSLASH | ESCAPE_WITH_HTML_QUOTE
*
*
* @return string correctly formatted attribute. Space at the end.
* @throws \CodeException
*/
......
......@@ -172,7 +172,14 @@ QfqNS.Element = QfqNS.Element || {};
* @param required
*/
n.FormGroup.prototype.setRequired = function (required) {
this.$element.prop('required', required);
if(this.$element.is('div')) {
if (!!this.$element.find('input')) {
console.log("children found");
this.$element.find('input').prop('required', required);
}
} else {
this.$element.prop('required', required);
}
};
/**
......@@ -181,9 +188,9 @@ QfqNS.Element = QfqNS.Element || {};
*/
n.FormGroup.prototype.setError = function (isError) {
if (isError) {
this.$formGroup.addClass("hullahoop has-error has-danger");
this.$formGroup.addClass("has-error has-danger");
} else {
this.$formGroup.removeClass("hullahoop has-error has-danger");
this.$formGroup.removeClass("has-error has-danger");
}
};
......
......@@ -72,13 +72,13 @@ QfqNS.Helper = QfqNS.Helper || {};
var me = editor;
var $parent = $(config.selector);
$parent.parent('div').mouseenter(function(e) {
console.log("Mouse Enter");
console.log($parent.is('[disabled]'));
if($parent.is('[disabled]')) {
$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");
}
});
};
......
......@@ -152,6 +152,11 @@ var QfqNS = QfqNS || {};
this.form.on('form.validation.failed', this.validationError);
this.form.on('form.validation.success', this.validationSuccess);
// Solves problem of leaving the page without releasing locks.
window.onbeforeunload = function (e) {
that.releaseLock();
};
$(".radio-inline").append($("<span>", { class: "checkmark", aria: "hidden"}));
$(".checkbox-inline").append($("<span>", { class: "checkmark", aria: "hidden"}));
$(".radio").append($("<span>", { class: "checkmark", aria: "hidden"}));
......@@ -1233,6 +1238,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);
}
......@@ -1253,6 +1266,17 @@ var QfqNS = QfqNS || {};
if (configurationItem.required !== undefined) {
element.setRequired(configuration.required);
if(element.$element) {
if(element.$element.is("select")) {
element.$element.prop('required', configurationItem.required);
element.$element.attr('data-required', 'yes');
}
if(element.$element.is("input[type=hidden]")) {
console.log("Update Hidden");
element.$element.prop("required", configurationItem.required);
}
}
}
} catch (e) {
n.Log.error(e.message);
......@@ -1358,6 +1382,9 @@ var QfqNS = QfqNS || {};
*/
n.QfqForm.prototype.goBack = function () {
var alert;
if(this.lockAcquired) {
this.releaseLock();
}
if (window.history.length < 2) {
alert = new n.Alert(
......
......@@ -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