From dca5016c25887073a31d592ea323a38d2c209ef8 Mon Sep 17 00:00:00 2001 From: Harry Bomrah Date: Mon, 6 Mar 2017 14:56:12 +0800 Subject: [PATCH] fix for datetime type --- app/assets/javascripts/survey.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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++; })