Skip to content

Commit

Permalink
Fixed Issue #11492: Answer Lists (DropDowns) disappeared from all my …
Browse files Browse the repository at this point in the history
…surveys
  • Loading branch information
markusfluer committed Jul 26, 2016
1 parent 222f4fc commit a4c08ec
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions scripts/survey_runtime.js
Expand Up @@ -603,11 +603,15 @@ function doToolTipTable()
$(document).ready(
function(){
$('.question-container').each(function(){
if($(this).find('div.answer-container').find('input').length == 1){
if($(this).find('div.answer-container').find('input[type=hidden]').length >0){
if($(this).find('div.answer-container').find('input').length == 1)
{
if($(this).find('div.answer-container').find('input[type=hidden]').length >0
&& $(this).find('div.answer-container').find('select').length < 1)
{
$(this).find('div.answer-container').css({display: 'none'});
}
if(trim($(this).find('div.question-help-container').find('div').html()) == ""){
if(trim($(this).find('div.question-help-container').find('div').html()) == "")
{
$(this).find('div.question-help-container').css({display: 'none'});
}
}
Expand Down

3 comments on commit a4c08ec

@Shnoulle
Copy link
Collaborator

@Shnoulle Shnoulle commented on a4c08ec Jul 26, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All this javascript only to hide "answer part" of boilerplate question ? And empty help question ?

Really ?

  1. This not a core issue , but a template issue
  2. Css is here to hide it : See https://www.limesurvey.org/forum/design-issues/105751-remove-answer-container-from-text-display-questions
  3. for question-help-container .question-help-container:empty{display:none} , after removing the line feed in the template.

And hre : if you want to do it in JS : template.js please. Not a core issue.

@maziminke
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Due to different class names at different templates (custom templates may use different names and/or additional JS code) I recommend to better change this directly at the PHP code which creates the question HTML for that question type.
Should be qanda_helper.php.

@Shnoulle
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NO ! it must be in template .... if you put it in PHP : it use the default template class name ....

Please sign in to comment.