Skip to content

Commit

Permalink
smother table updates
Browse files Browse the repository at this point in the history
  • Loading branch information
wwelling committed Aug 15, 2018
1 parent 02c26d6 commit f0e7bde
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 6 deletions.
2 changes: 1 addition & 1 deletion app/config/appConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ var appConfig = {
// Set this to the webService if mocking AuthService

'authService': 'https://labs.library.tamu.edu/auth3',
'webService': 'http://localhost:9001',
'webService': 'http://janus.evans.tamu.edu:9001',

'storageType': 'session',

Expand Down
14 changes: 13 additions & 1 deletion app/controllers/projectController.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,20 @@ app.controller('ProjectController', function ($controller, $scope, ApiResponseAc
};

RemoteProjectManagerRepo.listen([ApiResponseActions.CREATE, ApiResponseActions.DELETE, ApiResponseActions.UPDATE], function () {
$scope.remoteProjectManagers = RemoteProjectManagerRepo.getAll();
$scope.remoteProjectManagers.length = 0;
var remoteProjectManagers = RemoteProjectManagerRepo.getAll();
for (var i in remoteProjectManagers) {
$scope.remoteProjectManagers.push(remoteProjectManagers[i]);
}
});
}

ProjectRepo.listen([ApiResponseActions.CREATE, ApiResponseActions.DELETE, ApiResponseActions.UPDATE], function () {
$scope.projects.length = 0;
var projects = ProjectRepo.getAll();
for (var i in projects) {
$scope.projects.push(projects[i]);
}
});

});
6 changes: 5 additions & 1 deletion app/controllers/remoteProjectManagerController.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,11 @@ app.controller('RemoteProjectManagerController', function ($controller, $scope,
};

RemoteProjectManagerRepo.listen([ApiResponseActions.CREATE, ApiResponseActions.DELETE, ApiResponseActions.UPDATE], function () {
$scope.remoteProjectManagers = RemoteProjectManagerRepo.getAll();
$scope.remoteProjectManagers.length = 0;
var remoteProjectManagers = RemoteProjectManagerRepo.getAll();
for (var i in remoteProjectManagers) {
$scope.remoteProjectManagers.push(remoteProjectManagers[i]);
}
});

});
8 changes: 6 additions & 2 deletions app/controllers/statusController.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,12 @@ app.controller('StatusController', function ($controller, $scope, ApiResponseAct
}
};

StatusRepo.listen([ApiResponseActions.CREATE, ApiResponseActions.DELETE, ApiResponseActions.UPDATE], function (arg) {
$scope.statuses = StatusRepo.getAll();
StatusRepo.listen([ApiResponseActions.CREATE, ApiResponseActions.DELETE, ApiResponseActions.UPDATE], function () {
$scope.statuses.length = 0;
var statuses = StatusRepo.getAll();
for (var i in statuses) {
$scope.statuses.push(statuses[i]);
}
});

});
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit f0e7bde

Please sign in to comment.