Commit ac8e5483 authored by Sean Hammond's avatar Sean Hammond

Update view model after save

Update AnnotationController's view model (vm) after successfully saving
a new annotation to the server for the first time.

This fixes two issues:

1. vm.annotationURI (which depends on the annotation's id, which is not
present until the save to the server succeeds) was not being set
correctly after successful save, so the annotation permalinks were not
correct until you reload them.

2. If you created a highlight while logged out, then logged in,
(AnnotationController automatically saves the highlight to the server
for you on login) the "Only Me" icon was not being shown on the
highlight until you reloaded it because vm.isPrivate wasn't set.
parent 76ed603a
......@@ -630,6 +630,7 @@ function AnnotationController(
var onFulfilled = function() {
$rootScope.$emit('annotationCreated', domainModel);
updateViewModel(domainModel, vm, permissions);
view();
drafts.remove(domainModel);
};
......
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