Fix Bug #1143: Add or remove blocked class to the kanban card when the US is updated

stable
David Barragán Merino 2014-10-02 19:29:07 +02:00
parent 50bc2c27a8
commit 2c422ba82e
1 changed files with 6 additions and 2 deletions

View File

@ -324,14 +324,18 @@ KanbanUserstoryDirective = ($rootscope) ->
link = ($scope, $el, $attrs, $model) ->
$el.disableSelection()
$scope.$watch "us", (us) ->
if us.is_blocked and not $el.hasClass("blocked")
$el.addClass("blocked")
else if not us.is_blocked and $el.hasClass("blocked")
$el.removeClass("blocked")
$el.find(".icon-edit").on "click", (event) ->
if $el.find(".icon-edit").hasClass("noclick")
return
$scope.$apply ->
$rootscope.$broadcast("usform:edit", $model.$modelValue)
if $scope.us.is_blocked
$el.addClass("blocked")
$scope.$on "$destroy", ->
$el.off()