Commit 46a816f5 authored by bbaer's avatar bbaer
Browse files

Added new variable activateFirstRequiredTab Feedback #9805

parent e681f952
Pipeline #3078 failed with stages
in 7 minutes and 13 seconds
......@@ -54,6 +54,8 @@ var QfqNS = QfqNS || {};
this.formImmutableDueToConcurrentAccess = false;
this.lockRenewalPhase = false;
this.goToAfterSave = false;
this.skipRequiredCheck = false;
this.activateFirstRequiredTab = true;
this.additionalQueryParameters = {
'recordHashMd5': this.getRecordHashMd5()
......@@ -73,6 +75,10 @@ var QfqNS = QfqNS || {};
this.skipRequiredCheck = false;
}
if (typeof $('#' + QfqNS.escapeJqueryIdSelector(this.formId)).data('activate-first-required-tab') !== 'undefined') {
this.activateFirstRequiredTab = $('#' + QfqNS.escapeJqueryIdSelector(this.formId)).data('activate-first-required-tab');
}
this.infoLockedButton = this.infoLockedButton.bind(this);
// This is required when displaying validation messages, in order to activate the tab, which has validation
......@@ -624,10 +630,11 @@ var QfqNS = QfqNS || {};
if (this.form.validate() !== true) {
var element = this.form.getFirstNonValidElement();
if (element.hasAttribute('name') && this.bsTabs) {
var tabId = this.bsTabs.getContainingTabIdForFormControl(element.getAttribute('name'));
if (tabId) {
if (tabId && this.activateFirstRequiredTab) {
this.bsTabs.activateTab(tabId);
}
......
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