From 12e8c9cc97f76a01c6fb7d78d8584fae4c01239f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Espino?= Date: Wed, 17 Sep 2014 12:39:55 +0200 Subject: [PATCH] Fix bug #1028: Not show last sprint name at the same time of a validation error --- app/coffee/modules/backlog/lightboxes.coffee | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/coffee/modules/backlog/lightboxes.coffee b/app/coffee/modules/backlog/lightboxes.coffee index 15802013..49daa9ce 100644 --- a/app/coffee/modules/backlog/lightboxes.coffee +++ b/app/coffee/modules/backlog/lightboxes.coffee @@ -30,6 +30,7 @@ module = angular.module("taigaBacklog") CreateEditSprint = ($repo, $confirm, $rs, $rootscope, lightboxService, $loading) -> link = ($scope, $el, attrs) -> + hasErrors = false createSprint = true $scope.sprint = { project: null @@ -41,7 +42,10 @@ CreateEditSprint = ($repo, $confirm, $rs, $rootscope, lightboxService, $loading) submit = (event) -> form = $el.find("form").checksley() if not form.validate() + hasErrors = true + $el.find(".last-sprint-name").addClass("disappear") return + hasErrors = false newSprint = angular.copy($scope.sprint) @@ -132,7 +136,7 @@ CreateEditSprint = ($repo, $confirm, $rs, $rootscope, lightboxService, $loading) $el.find(".last-sprint-name").addClass("disappear") $el.on "keyup", ".sprint-name", (event) -> - if $el.find(".sprint-name").val().length > 0 + if $el.find(".sprint-name").val().length > 0 or hasErrors $el.find(".last-sprint-name").addClass("disappear") else $el.find(".last-sprint-name").removeClass("disappear")