Skip to content

Commit

Permalink
fix(fields): fields not hidden correctly
Browse files Browse the repository at this point in the history
Signed-off-by: Thierry Bugier <tbugier@teclib.com>
  • Loading branch information
btry committed Nov 27, 2018
1 parent 7d7b170 commit 0c75a69
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions js/scripts.js.php
Original file line number Diff line number Diff line change
Expand Up @@ -582,8 +582,6 @@ function deleteTarget(items_id, token, target_id) {
var formcreatorQuestions = new Object();

function formcreatorShowFields(form) {
//var form = $(field[0].form);

$.ajax({
url: '../ajax/showfields.php',
type: "POST",
Expand All @@ -600,14 +598,14 @@ function formcreatorShowFields(form) {
questionId = parseInt(questionKey.replace('formcreator_field_', ''));
if (!isNaN(questionId)) {
if (questionToShow[questionKey]) {
$('#form-group-field' + questionKey).show();
$('#form-group-field-' + questionKey).show();
i++;
$('#form-group-field' + questionKey).removeClass('line' + (i+1) % 2);
$('#form-group-field' + questionKey).addClass('line' + i%2);
$('#form-group-field-' + questionKey).removeClass('line' + (i+1) % 2);
$('#form-group-field-' + questionKey).addClass('line' + i%2);
} else {
$('#form-group-field' + questionKey).hide();
$('#form-group-field' + questionKey).removeClass('line0');
$('#form-group-field' + questionKey).removeClass('line1');
$('#form-group-field-' + questionKey).hide();
$('#form-group-field-' + questionKey).removeClass('line0');
$('#form-group-field-' + questionKey).removeClass('line1');
}
}
}
Expand Down

0 comments on commit 0c75a69

Please sign in to comment.