Commit bc8ddbb0 authored by Benjamin Baer's avatar Benjamin Baer
Browse files

Merge branch 'B9734-dirtyLockRelease' into 'develop'

B9734 dirty lock release

See merge request !220
parents b6c52394 9e078315
Pipeline #2909 passed with stages
in 3 minutes and 25 seconds
...@@ -172,7 +172,14 @@ QfqNS.Element = QfqNS.Element || {}; ...@@ -172,7 +172,14 @@ QfqNS.Element = QfqNS.Element || {};
* @param required * @param required
*/ */
n.FormGroup.prototype.setRequired = function (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 || {}; ...@@ -181,9 +188,9 @@ QfqNS.Element = QfqNS.Element || {};
*/ */
n.FormGroup.prototype.setError = function (isError) { n.FormGroup.prototype.setError = function (isError) {
if (isError) { if (isError) {
this.$formGroup.addClass("hullahoop has-error has-danger"); this.$formGroup.addClass("has-error has-danger");
} else { } else {
this.$formGroup.removeClass("hullahoop has-error has-danger"); this.$formGroup.removeClass("has-error has-danger");
} }
}; };
......
...@@ -152,6 +152,11 @@ var QfqNS = QfqNS || {}; ...@@ -152,6 +152,11 @@ var QfqNS = QfqNS || {};
this.form.on('form.validation.failed', this.validationError); this.form.on('form.validation.failed', this.validationError);
this.form.on('form.validation.success', this.validationSuccess); 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"})); $(".radio-inline").append($("<span>", { class: "checkmark", aria: "hidden"}));
$(".checkbox-inline").append($("<span>", { class: "checkmark", aria: "hidden"})); $(".checkbox-inline").append($("<span>", { class: "checkmark", aria: "hidden"}));
$(".radio").append($("<span>", { class: "checkmark", aria: "hidden"})); $(".radio").append($("<span>", { class: "checkmark", aria: "hidden"}));
...@@ -1261,9 +1266,14 @@ var QfqNS = QfqNS || {}; ...@@ -1261,9 +1266,14 @@ var QfqNS = QfqNS || {};
element.setRequired(configuration.required); element.setRequired(configuration.required);
if(element.$element) { if(element.$element) {
if(element.$element.is("select")) { if(element.$element.is("select")) {
element.$element.prop('required', configuration.required); element.$element.prop('required', configurationItem.required);
element.$element.attr('data-required', 'yes'); 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) { } catch (e) {
...@@ -1354,6 +1364,9 @@ var QfqNS = QfqNS || {}; ...@@ -1354,6 +1364,9 @@ var QfqNS = QfqNS || {};
*/ */
n.QfqForm.prototype.goBack = function () { n.QfqForm.prototype.goBack = function () {
var alert; var alert;
if(this.lockAcquired) {
this.releaseLock();
}
if (window.history.length < 2) { if (window.history.length < 2) {
alert = new n.Alert( alert = new n.Alert(
......
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