Merge pull request #1259 from taigaio/issue/5042/fold-unfold-cards

Show fold/unfold button in cards only when needed
stable
Juanfran 2017-03-23 14:30:44 +01:00 committed by GitHub
commit ff7ac8498a
2 changed files with 7 additions and 1 deletions

View File

@ -1,6 +1,6 @@
.card-unfold.ng-animate-disabled(
ng-click="vm.toggleFold()"
ng-if="vm.visible('unfold')"
ng-if="vm.visible('unfold') && (vm.hasTasks() || vm.hasVisibleAttachments())"
role="button"
)
tg-svg(svg-icon="icon-view-more")

View File

@ -23,6 +23,12 @@ class CardController
visible: (name) ->
return @.zoom.indexOf(name) != -1
hasTasks: () ->
return @.item.getIn(['model', 'tasks']).size > 0
hasVisibleAttachments: () ->
return @.item.get('images').size > 0
toggleFold: () ->
@.onToggleFold({id: @.item.get('id')})