Commit 4fcfa4bc authored by Sean Hammond's avatar Sean Hammond

Remove view() from AnnotationController.vm

This function isn't part of the view model, it's never called by the
templates, only by code in annotation.js itself.
parent 5780207b
...@@ -396,6 +396,14 @@ function AnnotationController( ...@@ -396,6 +396,14 @@ function AnnotationController(
}, nextUpdate, false); }, nextUpdate, false);
} }
/** Switches the view to a viewer, closing the editor controls if they're
* open.
* @name annotation.AnnotationController#view
*/
function view() {
vm.action = 'view';
}
/** /**
* @ngdoc method * @ngdoc method
* @name annotation.AnnotationController#authorize * @name annotation.AnnotationController#authorize
...@@ -589,7 +597,7 @@ function AnnotationController( ...@@ -589,7 +597,7 @@ function AnnotationController(
$rootScope.$emit('annotationDeleted', model); $rootScope.$emit('annotationDeleted', model);
} else { } else {
updateViewModel(drafts, model, vm); updateViewModel(drafts, model, vm);
vm.view(); view();
} }
}; };
...@@ -619,7 +627,7 @@ function AnnotationController( ...@@ -619,7 +627,7 @@ function AnnotationController(
updateDomainModel(model, vm.annotation); updateDomainModel(model, vm.annotation);
var onFulfilled = function() { var onFulfilled = function() {
$rootScope.$emit('annotationCreated', model); $rootScope.$emit('annotationCreated', model);
vm.view(); view();
}; };
var onRejected = function(reason) { var onRejected = function(reason) {
flash.error( flash.error(
...@@ -633,7 +641,7 @@ function AnnotationController( ...@@ -633,7 +641,7 @@ function AnnotationController(
onFulfilled = function() { onFulfilled = function() {
angular.copy(updatedModel, model); angular.copy(updatedModel, model);
$rootScope.$emit('annotationUpdated', model); $rootScope.$emit('annotationUpdated', model);
vm.view(); view();
}; };
onRejected = function(reason) { onRejected = function(reason) {
flash.error( flash.error(
...@@ -694,16 +702,6 @@ function AnnotationController( ...@@ -694,16 +702,6 @@ function AnnotationController(
return $q.when(tags.filter(query)); return $q.when(tags.filter(query));
}; };
/**
* @ngdoc method
* @name annotation.AnnotationController#view
* @description Switches the view to a viewer, closing the editor controls
* if they are open.
*/
vm.view = function() {
vm.action = 'view';
};
init(); init();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment