added ng-disabled to prev and next field buttons

This commit is contained in:
David Baldwynn 2015-11-10 22:15:59 -08:00
parent af3df34e84
commit 71735f3bec
2 changed files with 3 additions and 3 deletions

View file

@ -29,7 +29,7 @@ angular.module('forms').directive('submitFormDirective', ['$http', '$timeout', '
};
$scope.nextField = function(){
if($scope.selected.index < $scope.myform.form_fields.length){
if($scope.selected.index < $scope.myform.form_fields.length-1){
$scope.selected.index++;
$scope.selected._id = $scope.myform.form_fields[$scope.selected.index]._id;
}

View file

@ -67,10 +67,10 @@
<a href="/#!/forms/{{myform._id}}/admin/create" class="btn btn-default">Edit this NodeForm</a>
</div>
<div class="col-md-1 col-md-offset-2" style="padding-left:5px" class="hidden-sm hidden-xs">
<div class="btn btn-info" id="focusDownButton" ng-click="nextField()">\/</div>
<button class="btn btn-info" id="focusDownButton" ng-click="nextField()" ng-disabled="selected.index == myform.form_fields.length-1">\/</button>
</div>
<div class="col-md-1" class="hidden-sm hidden-xs">
<div class="btn btn-info" id="focusUpButton" ng-click="prevField()">/\</div>
<button class="btn btn-info" id="focusUpButton" ng-click="prevField()" ng-disabled="selected.index == 0">/\</button>
</div>
</div>
</div>