Skip to content

Commit

Permalink
Fixed issue #19251: Can't add Regex condition in survey (#3710)
Browse files Browse the repository at this point in the history
Co-authored-by: lapiudevgit <devgit@lapiu.biz>
  • Loading branch information
gabrieljenik and lapiudevgit committed Jan 29, 2024
1 parent 9986adc commit f9bd362
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
Expand Up @@ -124,7 +124,7 @@ class='form-control'
</div>
</div>

<div role='tabpanel' class='tab-pane active' id='QUICKADD-PREVQUESTIONS'>
<div role='tabpanel' class='tab-pane' id='QUICKADD-PREVQUESTIONS'>
<div class='mb-3 answer-option row'>
<div class='col-md-2'></div>
<div class='col-md-10'>
Expand Down
24 changes: 12 additions & 12 deletions assets/scripts/admin/conditions.js
Expand Up @@ -143,36 +143,36 @@ $(document).on('ready pjax:scriptcomplete', function(){
// Tab management for add/edit condition
var editTargetTab = $('input[name="editTargetTab"]').val();
var editSourceTab = $('input[name="editSourceTab"]').val();
$('a[href="' + editTargetTab + '"]').trigger('click');
$('a[href="' + editSourceTab + '"]').trigger('click');
$('a[href="' + editTargetTab + '"]').tab('show');
$('a[href="' + editSourceTab + '"]').tab('show');

// When user clicks tab, update hidden input
$('#editconditions .src-tab').on('click', function(e) {
var href = $(e.currentTarget).find('a').attr('href');
$('#editconditions .src-tab a.nav-link').on('shown.bs.tab', function(e) {
var href = $(this).attr('href');
$('input[name="editSourceTab"]').val(href);
});

// When user clicks tab, update hidden input
$('#editconditions .target-tab').on('click', function(e) {
var href = $(e.currentTarget).find('a').attr('href');
$('#editconditions .target-tab a.nav-link').on('shown.bs.tab', function(e) {
var href = $(this).attr('href');
$('input[name="editTargetTab"]').val(href);
});

// Tab management for quick-add modal
var editTargetTab = $('input[name="quick-add-editTargetTab"]').val();
var editSourceTab = $('input[name="quick-add-editSourceTab"]').val();
$('a[href="' + editTargetTab + '"]').trigger('click');
$('a[href="' + editSourceTab + '"]').trigger('click');
$('a[href="' + editTargetTab + '"]').tab('show');
$('a[href="' + editSourceTab + '"]').tab('show');

// When user clicks tab, update hidden input
$('#quick-add-conditions-form .src-tab').on('click', function(e) {
var href = $(e.currentTarget).find('a').attr('href');
$('#quick-add-conditions-form .src-tab a.nav-link').on('shown.bs.tab', function(e) {
var href = $(this).attr('href');
$('input[name="quick-add-editSourceTab"]').val(href);
});

// When user clicks tab, update hidden input
$('#quick-add-conditions-form .target-tab').on('click', function(e) {
var href = $(e.currentTarget).find('a').attr('href');
$('#quick-add-conditions-form .target-tab a.nav-link').on('shown.bs.tab', function(e) {
var href = $(this).attr('href');
$('input[name="quick-add-editTargetTab"]').val(href);
});

Expand Down

0 comments on commit f9bd362

Please sign in to comment.