Survey Maker

on typeChange of survey question, clear out the values of any downstream components
This commit is contained in:
Jared Tabor
2014-11-26 14:26:07 -05:00
parent 71d0f3af80
commit cfbec378c3
2 changed files with 12 additions and 11 deletions

View File

@@ -150,7 +150,7 @@ function($location, Wait, GetBasePath, LookUpInit, JobTemplateForm, CredentialLi
// html+='<br>job_launch_form.$valid = {{job_launch_form.$valid}}<br>'; // html+='<br>job_launch_form.$valid = {{job_launch_form.$valid}}<br>';
html+='</form>'; html+='</form>';
$('#password-modal').empty().html(html); $('#password-modal').empty().html(html);
$('#password-modal').find('textarea').before(scope.helpContainer); $('#password-modal').find('#job_extra_vars').before(scope.helpContainer);
e = angular.element(document.getElementById('password-modal')); e = angular.element(document.getElementById('password-modal'));
$compile(e)(scope); $compile(e)(scope);

View File

@@ -633,16 +633,17 @@ angular.module('SurveyHelper', [ 'Utilities', 'RestServices', 'SchedulesHelper',
}; };
scope.typeChange = function() { scope.typeChange = function() {
// alert('typechange'); scope.default = "";
scope.default = null; scope.default_multiselect = "";
scope.default_multiselect = null; scope.default_float = "";
scope.default_float = null; scope.default_int = "";
scope.default_int = null; scope.default_textarea = "";
scope.default_textarea = null; scope.survey_question_form.choices.$setPristine();
scope.int_min = null; scope.choices = "";
scope.int_max = null; scope.int_min = "";
scope.float_min = null; scope.int_max = "";
scope.float_max = null; scope.float_min = "";
scope.float_max = "";
}; };
scope.submitQuestion = function(){ scope.submitQuestion = function(){