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) {
|
$scope.createCard = function (stack, title) {
|
||||||
|
if (this['addCardForm' + stack].$valid) {
|
||||||
var newCard = {
|
var newCard = {
|
||||||
'title': title,
|
'title': title,
|
||||||
'stackId': stack,
|
'stackId': stack,
|
||||||
@@ -198,6 +199,7 @@ app.controller('BoardController', function ($rootScope, $scope, $stateParams, St
|
|||||||
$scope.stackservice.addCard(data);
|
$scope.stackservice.addCard(data);
|
||||||
$scope.newCard.title = '';
|
$scope.newCard.title = '';
|
||||||
});
|
});
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.stackDelete = function (stack) {
|
$scope.stackDelete = function (stack) {
|
||||||
|
|||||||
@@ -152,9 +152,12 @@
|
|||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<!-- CREATE CARD //-->
|
<!-- CREATE CARD //-->
|
||||||
<div class="card create" ng-class="{emptyStack: !s.cards.length}"
|
<div
|
||||||
ng-style="{'border-color':'#{{ boardservice.getCurrent().color }}'}" ng-if="boardservice.canEdit() && checkCanEdit() && params.filter!=='archive'">
|
class="card create"
|
||||||
<form ng-submit="createCard(s.id, newCard.title)">
|
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]">
|
<h4 ng-if="status.addCard[s.id]">
|
||||||
<input type="text" autofocus-on-insert
|
<input type="text" autofocus-on-insert
|
||||||
ng-model="newCard.title"
|
ng-model="newCard.title"
|
||||||
|
|||||||
Reference in New Issue
Block a user