Merge pull request #59 from taigaio/bug/1143/kanban-error-when-blocked-us
Fix Bug #1143: Add or remove blocked class to the kanban card when US is updatedstable
commit
2f287481a9
|
@ -257,13 +257,16 @@ module.controller("KanbanController", KanbanController)
|
||||||
|
|
||||||
KanbanDirective = ($repo, $rootscope) ->
|
KanbanDirective = ($repo, $rootscope) ->
|
||||||
link = ($scope, $el, $attrs) ->
|
link = ($scope, $el, $attrs) ->
|
||||||
|
|
||||||
tableBodyDom = $el.find(".kanban-table-body")
|
tableBodyDom = $el.find(".kanban-table-body")
|
||||||
|
|
||||||
tableBodyDom.on "scroll", (event) ->
|
tableBodyDom.on "scroll", (event) ->
|
||||||
target = angular.element(event.currentTarget)
|
target = angular.element(event.currentTarget)
|
||||||
tableHeaderDom = $el.find(".kanban-table-header .kanban-table-inner")
|
tableHeaderDom = $el.find(".kanban-table-header .kanban-table-inner")
|
||||||
tableHeaderDom.css("left", -1 * target.scrollLeft())
|
tableHeaderDom.css("left", -1 * target.scrollLeft())
|
||||||
|
|
||||||
|
$scope.$on "$destroy", ->
|
||||||
|
$el.off()
|
||||||
|
|
||||||
return {link: link}
|
return {link: link}
|
||||||
|
|
||||||
module.directive("tgKanban", ["$tgRepo", "$rootScope", KanbanDirective])
|
module.directive("tgKanban", ["$tgRepo", "$rootScope", KanbanDirective])
|
||||||
|
@ -280,10 +283,14 @@ KanbanRowWidthFixerDirective = ->
|
||||||
size = (statuses.length * itemSize) - 10
|
size = (statuses.length * itemSize) - 10
|
||||||
$el.css("width", "#{size}px")
|
$el.css("width", "#{size}px")
|
||||||
|
|
||||||
|
$scope.$on "$destroy", ->
|
||||||
|
$el.off()
|
||||||
|
|
||||||
return {link: link}
|
return {link: link}
|
||||||
|
|
||||||
module.directive("tgKanbanRowWidthFixer", KanbanRowWidthFixerDirective)
|
module.directive("tgKanbanRowWidthFixer", KanbanRowWidthFixerDirective)
|
||||||
|
|
||||||
|
|
||||||
#############################################################################
|
#############################################################################
|
||||||
## Kanban Column Height Fixer Directive
|
## Kanban Column Height Fixer Directive
|
||||||
#############################################################################
|
#############################################################################
|
||||||
|
@ -301,6 +308,9 @@ KanbanColumnHeightFixerDirective = ->
|
||||||
link = ($scope, $el, $attrs) ->
|
link = ($scope, $el, $attrs) ->
|
||||||
timeout(500, -> renderSize($el))
|
timeout(500, -> renderSize($el))
|
||||||
|
|
||||||
|
$scope.$on "$destroy", ->
|
||||||
|
$el.off()
|
||||||
|
|
||||||
return {link:link}
|
return {link:link}
|
||||||
|
|
||||||
|
|
||||||
|
@ -312,14 +322,23 @@ module.directive("tgKanbanColumnHeightFixer", KanbanColumnHeightFixerDirective)
|
||||||
|
|
||||||
KanbanUserstoryDirective = ($rootscope) ->
|
KanbanUserstoryDirective = ($rootscope) ->
|
||||||
link = ($scope, $el, $attrs, $model) ->
|
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) ->
|
$el.find(".icon-edit").on "click", (event) ->
|
||||||
if $el.find(".icon-edit").hasClass("noclick")
|
if $el.find(".icon-edit").hasClass("noclick")
|
||||||
return
|
return
|
||||||
|
|
||||||
$scope.$apply ->
|
$scope.$apply ->
|
||||||
$rootscope.$broadcast("usform:edit", $model.$modelValue)
|
$rootscope.$broadcast("usform:edit", $model.$modelValue)
|
||||||
if $scope.us.is_blocked
|
|
||||||
$el.addClass("blocked")
|
$scope.$on "$destroy", ->
|
||||||
$el.disableSelection()
|
$el.off()
|
||||||
|
|
||||||
return {
|
return {
|
||||||
templateUrl: "/partials/views/components/kanban-task.html"
|
templateUrl: "/partials/views/components/kanban-task.html"
|
||||||
|
@ -327,7 +346,6 @@ KanbanUserstoryDirective = ($rootscope) ->
|
||||||
require: "ngModel"
|
require: "ngModel"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
module.directive("tgKanbanUserstory", ["$rootScope", KanbanUserstoryDirective])
|
module.directive("tgKanbanUserstory", ["$rootScope", KanbanUserstoryDirective])
|
||||||
|
|
||||||
|
|
||||||
|
@ -351,6 +369,9 @@ KanbanWipLimitDirective = ->
|
||||||
$scope.$on "usform:new:success", redrawWipLimit
|
$scope.$on "usform:new:success", redrawWipLimit
|
||||||
$scope.$on "usform:bulk:success", redrawWipLimit
|
$scope.$on "usform:bulk:success", redrawWipLimit
|
||||||
|
|
||||||
|
$scope.$on "$destroy", ->
|
||||||
|
$el.off()
|
||||||
|
|
||||||
return {link: link}
|
return {link: link}
|
||||||
|
|
||||||
module.directive("tgKanbanWipLimit", KanbanWipLimitDirective)
|
module.directive("tgKanbanWipLimit", KanbanWipLimitDirective)
|
||||||
|
@ -412,7 +433,9 @@ KanbanUserDirective = ($log) ->
|
||||||
$ctrl = $el.controller()
|
$ctrl = $el.controller()
|
||||||
$ctrl.changeUsAssignedTo(us)
|
$ctrl.changeUsAssignedTo(us)
|
||||||
|
|
||||||
|
$scope.$on "$destroy", ->
|
||||||
|
$el.off()
|
||||||
|
|
||||||
return {link: link, require:"ngModel"}
|
return {link: link, require:"ngModel"}
|
||||||
|
|
||||||
|
|
||||||
module.directive("tgKanbanUserAvatar", ["$log", KanbanUserDirective])
|
module.directive("tgKanbanUserAvatar", ["$log", KanbanUserDirective])
|
||||||
|
|
Loading…
Reference in New Issue