OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 library tracker.web.tracker_app; | 5 library tracker.web.tracker_app; |
6 | 6 |
7 import 'package:polymer/polymer.dart'; | 7 import 'package:polymer/polymer.dart'; |
8 import 'package:tracker/models.dart'; | 8 import 'package:tracker/models.dart'; |
9 import 'package:tracker/seed.dart' as seed; | 9 import 'package:tracker/seed.dart' as seed; |
10 | 10 |
11 @CustomTag('tracker-app') | 11 @CustomTag('tracker-app') |
12 class TrackerApp extends PolymerElement with ObservableMixin { | 12 class TrackerApp extends PolymerElement with Observable { |
13 bool get applyAuthorStyles => true; | 13 bool get applyAuthorStyles => true; |
14 @observable final ObservableList<Task> tasks = toObservable([]); | 14 @observable final ObservableList<Task> tasks = toObservable([]); |
15 @observable Tracker app; | 15 @observable Tracker app; |
16 @observable Task newTask = new Task.unsaved(); | 16 @observable Task newTask = new Task.unsaved(); |
17 @observable String searchParam = ''; | 17 @observable String searchParam = ''; |
18 @observable bool usingForm = false; | 18 @observable bool usingForm = false; |
19 | 19 |
20 // Buckets for grouping tasks by status. | 20 // Buckets for grouping tasks by status. |
21 @observable List<Task> current = toObservable([]); | 21 @observable List<Task> current = toObservable([]); |
22 @observable List<Task> pending = toObservable([]); | 22 @observable List<Task> pending = toObservable([]); |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 if (task.status == Task.CURRENT) { | 86 if (task.status == Task.CURRENT) { |
87 current.add(task); | 87 current.add(task); |
88 } else if (task.status == Task.PENDING) { | 88 } else if (task.status == Task.PENDING) { |
89 pending.add(task); | 89 pending.add(task); |
90 } else { | 90 } else { |
91 completed.add(task); | 91 completed.add(task); |
92 } | 92 } |
93 } | 93 } |
94 } | 94 } |
95 } | 95 } |
OLD | NEW |