feat: add counter to collapsible and for local attachments

This commit is contained in:
Johannes Millan 2018-04-14 21:09:57 +02:00
parent a3d2b5f24d
commit 08339ad222
3 changed files with 9 additions and 3 deletions

View file

@ -3,6 +3,7 @@
<ng-md-icon class="collapsible-expand-icon"
icon="expand_more"></ng-md-icon>
<span ng-bind=":: vm.title"></span>
<span ng-if="vm.isCounter">(<span ng-bind="vm.counter||0"></span>)</span>
<ng-md-icon ng-if="vm.icon"
class="collapsible-icon"
icon="{{::vm.icon}}"></ng-md-icon>

View file

@ -12,6 +12,10 @@
function CollapsibleCtrl($timeout, $element) {
const vm = this;
if ($element.attr('counter')) {
vm.isCounter = true;
}
// TODO fix this
$timeout(() => {
if (vm.isInitiallyExpanded) {
@ -50,7 +54,8 @@
icon: '@',
isInitiallyExpanded: '@',
btnAction: '&',
btnIcon: '@'
btnIcon: '@',
counter: '<'
}
});
})();

View file

@ -213,9 +213,9 @@
<section>
<collapsible collapsible-title="Local attachments and links"
counter="task.localAttachments.length"
btn-action="$ctrl.addLocalAttachment(task)"
btn-icon="add"
is-initially-expanded="'true'">
btn-icon="add">
<task-local-links local-links="task.localAttachments"></task-local-links>
</collapsible>
</section>