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