Skip to content

Commit 08339ad

Browse files
committed
feat: add counter to collapsible and for local attachments
1 parent a3d2b5f commit 08339ad

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

app-src/scripts/collapsible/collapsible-d.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<ng-md-icon class="collapsible-expand-icon"
44
icon="expand_more"></ng-md-icon>
55
<span ng-bind=":: vm.title"></span>
6+
<span ng-if="vm.isCounter">(<span ng-bind="vm.counter||0"></span>)</span>
67
<ng-md-icon ng-if="vm.icon"
78
class="collapsible-icon"
89
icon="{{::vm.icon}}"></ng-md-icon>

app-src/scripts/collapsible/collapsible-d.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@
1212
function CollapsibleCtrl($timeout, $element) {
1313
const vm = this;
1414

15+
if ($element.attr('counter')) {
16+
vm.isCounter = true;
17+
}
18+
1519
// TODO fix this
1620
$timeout(() => {
1721
if (vm.isInitiallyExpanded) {
@@ -50,7 +54,8 @@
5054
icon: '@',
5155
isInitiallyExpanded: '@',
5256
btnAction: '&',
53-
btnIcon: '@'
57+
btnIcon: '@',
58+
counter: '<'
5459
}
5560
});
5661
})();

app-src/scripts/task-list/task-list-d.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,9 +213,9 @@
213213

214214
<section>
215215
<collapsible collapsible-title="Local attachments and links"
216+
counter="task.localAttachments.length"
216217
btn-action="$ctrl.addLocalAttachment(task)"
217-
btn-icon="add"
218-
is-initially-expanded="'true'">
218+
btn-icon="add">
219219
<task-local-links local-links="task.localAttachments"></task-local-links>
220220
</collapsible>
221221
</section>

0 commit comments

Comments
 (0)