fixed visible form fields display bug
This commit is contained in:
parent
a5776c6dc8
commit
10f26db043
21
public/dist/application.js
vendored
21
public/dist/application.js
vendored
|
@ -254,7 +254,7 @@ angular.module('NodeForm.templates', []).run(['$templateCache', function($templa
|
||||||
" <span class=col-xs-1 ng-switch=field.fieldType>\n" +
|
" <span class=col-xs-1 ng-switch=field.fieldType>\n" +
|
||||||
" <field-icon-directive type-name={{field.fieldType}}></field-icon-directive>\n" +
|
" <field-icon-directive type-name={{field.fieldType}}></field-icon-directive>\n" +
|
||||||
" </span>\n" +
|
" </span>\n" +
|
||||||
" <span style=col-xs-10>\n" +
|
" <span class=col-xs-10>\n" +
|
||||||
" {{field.title}} \n" +
|
" {{field.title}} \n" +
|
||||||
" <span ng-show=field.required>*</span>\n" +
|
" <span ng-show=field.required>*</span>\n" +
|
||||||
" </span>\n" +
|
" </span>\n" +
|
||||||
|
@ -1794,18 +1794,21 @@ angular.module('forms').directive('submitFormDirective', ['$http', 'TimeCounter'
|
||||||
$scope.reloadForm = function(){
|
$scope.reloadForm = function(){
|
||||||
//Reset Form
|
//Reset Form
|
||||||
$scope.myform.submitted = false;
|
$scope.myform.submitted = false;
|
||||||
$scope.myform.form_fields = _.chain($scope.myform.form_fields).map(function(field){
|
$scope.myform.form_fields = _.chain($scope.myform.visible_form_fields).map(function(field){
|
||||||
field.fieldValue = '';
|
field.fieldValue = '';
|
||||||
return field;
|
return field;
|
||||||
}).value();
|
}).value();
|
||||||
|
|
||||||
$scope.loading = false;
|
$scope.loading = false;
|
||||||
$scope.error = '';
|
$scope.error = '';
|
||||||
|
|
||||||
$scope.selected = {
|
$scope.selected = {
|
||||||
_id: $scope.myform.form_fields[0]._id,
|
_id: '',
|
||||||
index: 0,
|
index: 0
|
||||||
};
|
};
|
||||||
|
$scope.setActiveField($scope.myform.visible_form_fields[0]._id, 0, false);
|
||||||
|
|
||||||
|
console.log($scope.selected);
|
||||||
//Reset Timer
|
//Reset Timer
|
||||||
TimeCounter.restartClock();
|
TimeCounter.restartClock();
|
||||||
};
|
};
|
||||||
|
@ -1816,10 +1819,8 @@ angular.module('forms').directive('submitFormDirective', ['$http', 'TimeCounter'
|
||||||
$scope.fieldTop = elemBox.top;
|
$scope.fieldTop = elemBox.top;
|
||||||
$scope.fieldBottom = elemBox.bottom;
|
$scope.fieldBottom = elemBox.bottom;
|
||||||
|
|
||||||
console.log($scope.forms.myForm);
|
//console.log($scope.forms.myForm);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if(!$scope.noscroll){
|
if(!$scope.noscroll){
|
||||||
//Focus on submit button
|
//Focus on submit button
|
||||||
if( $scope.selected.index === $scope.myform.form_fields.length-1 && $scope.fieldBottom < 200){
|
if( $scope.selected.index === $scope.myform.form_fields.length-1 && $scope.fieldBottom < 200){
|
||||||
|
@ -1936,9 +1937,9 @@ angular.module('forms').directive('submitFormDirective', ['$http', 'TimeCounter'
|
||||||
};
|
};
|
||||||
|
|
||||||
//Load our form when the page is ready
|
//Load our form when the page is ready
|
||||||
angular.element(document).ready(function() {
|
//angular.element(document).ready(function() {
|
||||||
$scope.reloadForm();
|
$scope.reloadForm();
|
||||||
});
|
//});
|
||||||
|
|
||||||
}]
|
}]
|
||||||
};
|
};
|
||||||
|
|
6
public/dist/application.min.js
vendored
6
public/dist/application.min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -22,18 +22,21 @@ angular.module('forms').directive('submitFormDirective', ['$http', 'TimeCounter'
|
||||||
$scope.reloadForm = function(){
|
$scope.reloadForm = function(){
|
||||||
//Reset Form
|
//Reset Form
|
||||||
$scope.myform.submitted = false;
|
$scope.myform.submitted = false;
|
||||||
$scope.myform.form_fields = _.chain($scope.myform.form_fields).map(function(field){
|
$scope.myform.form_fields = _.chain($scope.myform.visible_form_fields).map(function(field){
|
||||||
field.fieldValue = '';
|
field.fieldValue = '';
|
||||||
return field;
|
return field;
|
||||||
}).value();
|
}).value();
|
||||||
|
|
||||||
$scope.loading = false;
|
$scope.loading = false;
|
||||||
$scope.error = '';
|
$scope.error = '';
|
||||||
|
|
||||||
$scope.selected = {
|
$scope.selected = {
|
||||||
_id: $scope.myform.form_fields[0]._id,
|
_id: '',
|
||||||
index: 0,
|
index: 0
|
||||||
};
|
};
|
||||||
|
$scope.setActiveField($scope.myform.visible_form_fields[0]._id, 0, false);
|
||||||
|
|
||||||
|
console.log($scope.selected);
|
||||||
//Reset Timer
|
//Reset Timer
|
||||||
TimeCounter.restartClock();
|
TimeCounter.restartClock();
|
||||||
};
|
};
|
||||||
|
@ -44,10 +47,8 @@ angular.module('forms').directive('submitFormDirective', ['$http', 'TimeCounter'
|
||||||
$scope.fieldTop = elemBox.top;
|
$scope.fieldTop = elemBox.top;
|
||||||
$scope.fieldBottom = elemBox.bottom;
|
$scope.fieldBottom = elemBox.bottom;
|
||||||
|
|
||||||
console.log($scope.forms.myForm);
|
//console.log($scope.forms.myForm);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if(!$scope.noscroll){
|
if(!$scope.noscroll){
|
||||||
//Focus on submit button
|
//Focus on submit button
|
||||||
if( $scope.selected.index === $scope.myform.form_fields.length-1 && $scope.fieldBottom < 200){
|
if( $scope.selected.index === $scope.myform.form_fields.length-1 && $scope.fieldBottom < 200){
|
||||||
|
@ -164,9 +165,9 @@ angular.module('forms').directive('submitFormDirective', ['$http', 'TimeCounter'
|
||||||
};
|
};
|
||||||
|
|
||||||
//Load our form when the page is ready
|
//Load our form when the page is ready
|
||||||
angular.element(document).ready(function() {
|
//angular.element(document).ready(function() {
|
||||||
$scope.reloadForm();
|
$scope.reloadForm();
|
||||||
});
|
//});
|
||||||
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -49,7 +49,6 @@ class="submission-form col-sm-12 col-md-offset-1 col-md-10">
|
||||||
ng-if="!field.deletePreserved"
|
ng-if="!field.deletePreserved"
|
||||||
data-index="{{$index}}"
|
data-index="{{$index}}"
|
||||||
data-id="{{field._id}}"
|
data-id="{{field._id}}"
|
||||||
du-scrollspy
|
|
||||||
ng-class="{activeField: selected._id == field._id }"
|
ng-class="{activeField: selected._id == field._id }"
|
||||||
class="row field-directive">
|
class="row field-directive">
|
||||||
<field-directive field="field" design="myform.design" index="$index">
|
<field-directive field="field" design="myform.design" index="$index">
|
||||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue