projects
/
angular-drzb
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7dfbd70
)
change change only to next one when editing existing registration
author
Dobrica Pavlinusic
<dpavlin@rot13.org>
Thu, 14 Feb 2013 16:02:04 +0000
(17:02 +0100)
committer
Dobrica Pavlinusic
<dpavlin@rot13.org>
Thu, 14 Feb 2013 16:02:04 +0000
(17:02 +0100)
app/js/controllers.js
patch
|
blob
|
history
diff --git
a/app/js/controllers.js
b/app/js/controllers.js
index
4ddca47
..
e52344d
100644
(file)
--- a/
app/js/controllers.js
+++ b/
app/js/controllers.js
@@
-17,7
+17,12
@@
function RegistrationCtrl($scope, $log, Registration, $routeParams, $location, $
$scope.update = function(registration, state, info_message) {
- registration.state = state;
+ if ( $scope.ValidStates.indexOf( state ) > $scope.ValidStates.indexOf( registration.state ) ) {
+ registration.state = state;
+ $log.info( 'registration.state updated to ',state);
+ } else {
+ $log.info('registration.state NOT changed');
+ }
if ( ! $scope.has_work && registration.work ) {
delete( registration.work );