fixed small error using float directive

i hadn't used the smart-float directive correctly and in all the right places. i also adjusted the default_float in survey maker->edit question function
This commit is contained in:
Jared Tabor 2014-10-16 09:48:46 -04:00
parent 90ae405424
commit 6292c8ddbd
3 changed files with 6 additions and 5 deletions

View File

@ -101,11 +101,11 @@ angular.module('SurveyQuestionFormDefinition', [])
type: 'custom',
control: '<div class="row">'+
'<div class="col-xs-6">'+
'<label for="minimum"><span class="label-text">Minimum</span></label><input id="float_min" type="number" name="float_min" ng-model="float_min" class="form-control" smartFloat >'+
'<label for="minimum"><span class="label-text">Minimum</span></label><input id="float_min" type="number" name="float_min" ng-model="float_min" class="form-control" smart-float >'+
'<div class="error" ng-show="survey_question_form.float_min.$invalid">This is not valid float!</div>'+
'</div>'+
'<div class="col-xs-6">'+
'<label for="minimum"><span class="label-text">Maximum</span></label><input id="float_max" type="number" name="float_max" ng-model="float_max" class="form-control" smartFloat >'+
'<label for="minimum"><span class="label-text">Maximum</span></label><input id="float_max" type="number" name="float_max" ng-model="float_max" class="form-control" smart-float >'+
'<div class="error" ng-show="survey_question_form.float_max.$invalid">This is not valid float!</div>'+
'</div>'+
'</div>',
@ -150,7 +150,7 @@ angular.module('SurveyQuestionFormDefinition', [])
type: 'custom',
control: '<div>'+
'<label for="default_float"><span class="label-text">Default Answer</span></label>'+
'<input type="number" ng-model="default_float" name="default_float" ng-min="float_min" ng-max="float_max" class="form-control" integer />'+
'<input type="number" ng-model="default_float" name="default_float" ng-min="float_min" ng-max="float_max" class="form-control" smart-float />'+
'<div class="error" ng-show="survey_question_form.default_float.$error.number || survey_question_form.default_float.$error.float">This is not valid float!</div>'+
'<div class="error" ng-show="survey_question_form.default_float.$error.ngMin || survey_question_form.default_float.$error.ngMax"> The value must be in range {{float_min}} to {{float_max}}!</div>'+
'</div>',

View File

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

View File

@ -423,7 +423,7 @@ angular.module('SurveyHelper', [ 'Utilities', 'RestServices', 'SchedulesHelper',
else if( question.type === 'float' ) {
scope.float_min = question.min;
scope.float_max = question.max;
scope.default_int = question.default;
scope.default_float = question.default;
}
else if ( question.type === 'multiselect'){