Commit 319641c 1 parent f591c5c commit 319641c Copy full SHA for 319641c
File tree 2 files changed +8
-2
lines changed
scripts/controllers/admin
2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change 81
81
} ;
82
82
83
83
$scope . addTask = function ( ) {
84
- $scope . openTaskDialog ( { order : $scope . template . tasks . length } , 'Add' ) ;
84
+ var order = $scope . template . tasks ? $scope . template . tasks . length : 0 ;
85
+
86
+ $scope . openTaskDialog ( { order : order } , 'Add' ) ;
85
87
} ;
86
88
87
89
$scope . editTask = function ( task ) {
175
177
176
178
$scope . addTask = function ( ) {
177
179
if ( action === 'Add' ) {
180
+ if ( $scope . template . tasks ) {
178
181
$scope . template . tasks . push ( task ) ;
182
+ } else {
183
+ $scope . template . tasks = [ task ] ;
184
+ }
179
185
}
180
186
181
187
$uibModalInstance . dismiss ( ) ;
Original file line number Diff line number Diff line change @@ -135,7 +135,7 @@ <h4 class="vpad10 text-primary">
135
135
</ div >
136
136
</ div >
137
137
</ div >
138
- < div class ="text-danger " ng-if ="template.tasks.length === 0 ">
138
+ < div class ="text-danger " ng-if ="!template.tasks || template.tasks.length === 0 ">
139
139
< table class ="table table-striped ">
140
140
< tr >
141
141
< td > No tasks have been specified</ td >
You can’t perform that action at this time.
0 commit comments