diff --git a/app/coffee/modules/taskboard.coffee b/app/coffee/modules/taskboard.coffee index c7f9a36e..323ef024 100644 --- a/app/coffee/modules/taskboard.coffee +++ b/app/coffee/modules/taskboard.coffee @@ -87,7 +87,7 @@ class TaskboardController extends mixOf(taiga.Controller, taiga.PageMixin) ############################################################################# ## TaskboardDirective ############################################################################# -taiga = @.taiga + TaskboardDirective = -> ######################### @@ -95,16 +95,10 @@ TaskboardDirective = -> ######################### linkSortable = ($scope, $el, $attrs, $ctrl) -> - console.log "TaskboardDirective:linkSortable" - taiga.bindOnce $scope, "statusList", (v) -> - console.log 33333, v - size = v.length * 300 - $el.find(".task-row").css("width", size + "px") link = ($scope, $el, $attrs) -> $ctrl = $el.controller() linkSortable($scope, $el, $attrs, $ctrl) - # linkCommon($scope, $el, $attrs, $ctrl) $scope.$on "$destroy", -> $el.off() @@ -112,6 +106,16 @@ TaskboardDirective = -> return {link: link} +TaskboardTaskrowDirective = -> + itemSize = 300 + link = ($scope, $el, $attrs) -> + taiga.bindOnce $scope, "statusList", (statuses) -> + size = (1 + statuses.length) * itemSize + $el.css("width", size + "px") + + return {link: link} + module = angular.module("taigaTaskboard", []) module.controller("TaskboardController", TaskboardController) module.directive("tgTaskboard", TaskboardDirective) +module.directive("tgTaskboardTaskrow", TaskboardTaskrowDirective) diff --git a/app/partials/views/modules/taskboard-table.jade b/app/partials/views/modules/taskboard-table.jade index 40dae1f4..3efe2349 100644 --- a/app/partials/views/modules/taskboard-table.jade +++ b/app/partials/views/modules/taskboard-table.jade @@ -1,11 +1,11 @@ div.taskboard-table div.taskboard-table-header - div.taskboard-table-inner + div.taskboard-table-inner(tg-taskboard-taskrow) h2.task-colum_name "User story" h2.task-colum_name(ng-repeat="s in statusList track by s.id", tg-bo-html="s.name") div.taskboard-table-body div.taskboard-table-inner - div.task-row(ng-repeat="us in userstories track by us.id") + div.task-row(ng-repeat="us in userstories track by us.id", tg-taskboard-taskrow) div.taskboard_task-list.task-column div.tag-list - for(var y = 0; y < 5; y++)