Save fold unfold status on storage
parent
38bb85bdf0
commit
53745273e6
|
@ -359,22 +359,22 @@ module.directive("tgKanbanUserstory", ["$rootScope", KanbanUserstoryDirective])
|
|||
## Kanban Squish Column Directive
|
||||
#############################################################################
|
||||
|
||||
KanbanSquishColumnDirective = ->
|
||||
KanbanSquishColumnDirective = (rs) ->
|
||||
|
||||
#TODO: Only header is folding/unfolding so
|
||||
# 1. Save folded/unfolded column status.
|
||||
# 2. Recalculate container width.
|
||||
# 1. Recalculate container width.
|
||||
|
||||
link = ($scope, $el, $attrs) ->
|
||||
$scope.folds = []
|
||||
$scope.$on "project:loaded", (event, project) ->
|
||||
$scope.folds = rs.kanban.getStatusColumnModes(project.id)
|
||||
|
||||
$scope.foldStatus = (status) ->
|
||||
$scope.folds[status.id] = !!!$scope.folds[status.id]
|
||||
if $scope.folds[status.id]
|
||||
fold()
|
||||
rs.kanban.storeStatusColumnModes($scope.projectId, $scope.folds)
|
||||
|
||||
return {link: link}
|
||||
|
||||
module.directive("tgKanbanSquishColumn", KanbanSquishColumnDirective)
|
||||
module.directive("tgKanbanSquishColumn", ["$tgResources", KanbanSquishColumnDirective])
|
||||
|
||||
#############################################################################
|
||||
## Kaban WIP Limit Directive
|
||||
|
|
|
@ -27,6 +27,7 @@ generateHash = taiga.generateHash
|
|||
resourceProvider = ($storage) ->
|
||||
service = {}
|
||||
hashSuffixStatusViewModes = "kanban-statusviewmodels"
|
||||
hashSuffixStatusColumnModes = "kanban-statuscolumnmodels"
|
||||
|
||||
service.storeStatusViewModes = (projectId, params) ->
|
||||
ns = "#{projectId}:#{hashSuffixStatusViewModes}"
|
||||
|
@ -38,6 +39,16 @@ resourceProvider = ($storage) ->
|
|||
hash = generateHash([projectId, ns])
|
||||
return $storage.get(hash) or {}
|
||||
|
||||
service.storeStatusColumnModes = (projectId, params) ->
|
||||
ns = "#{projectId}:#{hashSuffixStatusColumnModes}"
|
||||
hash = generateHash([projectId, ns])
|
||||
$storage.set(hash, params)
|
||||
|
||||
service.getStatusColumnModes = (projectId) ->
|
||||
ns = "#{projectId}:#{hashSuffixStatusColumnModes}"
|
||||
hash = generateHash([projectId, ns])
|
||||
return $storage.get(hash) or {}
|
||||
|
||||
return (instance) ->
|
||||
instance.kanban = service
|
||||
|
||||
|
|
Loading…
Reference in New Issue