Implements validation when adding new cards
Signed-off-by: Michael Weimann <mail@michael-weimann.eu>
This commit is contained in:
committed by
Julius Härtl
parent
84969180e2
commit
d17cd78605
@@ -189,6 +189,7 @@ app.controller('BoardController', function ($rootScope, $scope, $stateParams, St
|
||||
};
|
||||
|
||||
$scope.createCard = function (stack, title) {
|
||||
if (this['addCardForm' + stack].$valid) {
|
||||
var newCard = {
|
||||
'title': title,
|
||||
'stackId': stack,
|
||||
@@ -198,6 +199,7 @@ app.controller('BoardController', function ($rootScope, $scope, $stateParams, St
|
||||
$scope.stackservice.addCard(data);
|
||||
$scope.newCard.title = '';
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
$scope.stackDelete = function (stack) {
|
||||
|
||||
@@ -152,9 +152,12 @@
|
||||
</ul>
|
||||
|
||||
<!-- CREATE CARD //-->
|
||||
<div class="card create" ng-class="{emptyStack: !s.cards.length}"
|
||||
ng-style="{'border-color':'#{{ boardservice.getCurrent().color }}'}" ng-if="boardservice.canEdit() && checkCanEdit() && params.filter!=='archive'">
|
||||
<form ng-submit="createCard(s.id, newCard.title)">
|
||||
<div
|
||||
class="card create"
|
||||
ng-class="{emptyStack: !s.cards.length}"
|
||||
ng-style="{'border-color':'#{{ boardservice.getCurrent().color }}'}"
|
||||
ng-if="boardservice.canEdit() && checkCanEdit() && params.filter !== 'archive'">
|
||||
<form name="addCardForm{{ s.id }}" ng-submit="createCard(s.id, newCard.title)">
|
||||
<h4 ng-if="status.addCard[s.id]">
|
||||
<input type="text" autofocus-on-insert
|
||||
ng-model="newCard.title"
|
||||
|
||||
Reference in New Issue
Block a user