Skip to content

Commit dfb2d68

Browse files
committed
set page busy until tasks are loaded.
1 parent 949ae97 commit dfb2d68

File tree

2 files changed

+16
-10
lines changed
  • SimpleTaskSystem
    • SimpleTaskSystem.WebSpaAngular/App/Main/views/task
    • SimpleTaskSystem.WebSpaDurandal/App/Main/viewmodels

2 files changed

+16
-10
lines changed

SimpleTaskSystem/SimpleTaskSystem.WebSpaAngular/App/Main/views/task/list.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,14 @@
1818
});
1919

2020
vm.refreshTasks = function() {
21-
taskService.getTasks({
22-
state: $scope.selectedTaskState > 0 ? $scope.selectedTaskState : null
23-
}).success(function(data) {
24-
vm.tasks = data.tasks;
25-
});
21+
abp.ui.setBusy( //Set whole page busy until getTasks complete
22+
null,
23+
taskService.getTasks({
24+
state: $scope.selectedTaskState > 0 ? $scope.selectedTaskState : null
25+
}).success(function(data) {
26+
vm.tasks = data.tasks;
27+
})
28+
);
2629
};
2730

2831
vm.changeTaskState = function(task) {

SimpleTaskSystem/SimpleTaskSystem.WebSpaDurandal/App/Main/viewmodels/tasklist.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,14 @@
1515
};
1616

1717
that.refreshTasks = function () {
18-
taskService.getTasks({
19-
state: that.selectedTaskState() > 0 ? that.selectedTaskState() : null
20-
}).done(function (data) {
21-
ko.mapping.fromJS(data.tasks, that.tasks);
22-
});
18+
abp.ui.setBusy( //Set whole page busy until getTasks complete
19+
null,
20+
taskService.getTasks({
21+
state: that.selectedTaskState() > 0 ? that.selectedTaskState() : null
22+
}).done(function(data) {
23+
ko.mapping.fromJS(data.tasks, that.tasks);
24+
})
25+
);
2326
};
2427

2528
that.changeTaskState = function (task) {

0 commit comments

Comments
 (0)