diff --git a/app/assets/javascripts/survey.js b/app/assets/javascripts/survey.js index 1dfcb6e..e1ac835 100644 --- a/app/assets/javascripts/survey.js +++ b/app/assets/javascripts/survey.js @@ -124,7 +124,7 @@ function editQuestion (dataArray){ $('#template-survery').tmpl(setEditData(l, $('.questions > .attributes').length + 1, d)).appendTo($('.questions')); checkQuestionsLength(); textareaResizable(); // from textarea-lang-btn.js - if( (d.type > 1 && d.type < 5) || d.type == 6 ){ + if(d.type > 1 && d.type < 5){ onQuestionTypeChanged( $(".questions .field-type:eq("+ i +")"), d.type ); $.each(d.survey_question_options,function ( x, data ){ $('#template-survery-option').tmpl(setEditQuestionAttributes( l, "", data, x, "options" )).insertBefore($(".questions .field-type:eq("+ i +") .options .add-btn")); @@ -140,6 +140,8 @@ function editQuestion (dataArray){ $('#template-survery-option').tmpl(setEditQuestionAttributes( l, "", data, x, "options" )).insertBefore($(".questions .field-type:eq("+ i +") .options .add-btn")); $(".questions .field-type:eq("+ i +") .options").data("index",x); }) + }else if(d.type == 6){ + onQuestionTypeChanged( $(".questions .field-type:eq("+ i +")"), d.type ); } l++; })