Add size marker directive (partial)

stable
Andrey Antukh 2014-06-25 12:26:30 +02:00
parent d59dcfed38
commit 3306af6052
2 changed files with 13 additions and 9 deletions

View File

@ -87,7 +87,7 @@ class TaskboardController extends mixOf(taiga.Controller, taiga.PageMixin)
############################################################################# #############################################################################
## TaskboardDirective ## TaskboardDirective
############################################################################# #############################################################################
taiga = @.taiga
TaskboardDirective = -> TaskboardDirective = ->
######################### #########################
@ -95,16 +95,10 @@ TaskboardDirective = ->
######################### #########################
linkSortable = ($scope, $el, $attrs, $ctrl) -> 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) -> link = ($scope, $el, $attrs) ->
$ctrl = $el.controller() $ctrl = $el.controller()
linkSortable($scope, $el, $attrs, $ctrl) linkSortable($scope, $el, $attrs, $ctrl)
# linkCommon($scope, $el, $attrs, $ctrl)
$scope.$on "$destroy", -> $scope.$on "$destroy", ->
$el.off() $el.off()
@ -112,6 +106,16 @@ TaskboardDirective = ->
return {link: link} 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 = angular.module("taigaTaskboard", [])
module.controller("TaskboardController", TaskboardController) module.controller("TaskboardController", TaskboardController)
module.directive("tgTaskboard", TaskboardDirective) module.directive("tgTaskboard", TaskboardDirective)
module.directive("tgTaskboardTaskrow", TaskboardTaskrowDirective)

View File

@ -1,11 +1,11 @@
div.taskboard-table div.taskboard-table
div.taskboard-table-header 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 "User story"
h2.task-colum_name(ng-repeat="s in statusList track by s.id", tg-bo-html="s.name") 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-body
div.taskboard-table-inner 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.taskboard_task-list.task-column
div.tag-list div.tag-list
- for(var y = 0; y < 5; y++) - for(var y = 0; y < 5; y++)