- 03 Dec, 2015 19 commits
-
-
Robert Knight authored
Refactor annotation controller tests
-
Sean Hammond authored
-
Sean Hammond authored
-
Sean Hammond authored
-
Sean Hammond authored
-
Sean Hammond authored
-
Sean Hammond authored
-
Sean Hammond authored
Remove gloval `controller` variable from AnnotationController tests.
-
Sean Hammond authored
Move the tests for annotation.js's top-level function out of the 'AnnotationController' describe() - these functions aren't part of AnnotationController and their tests don't need all the setup in this describe().
-
Sean Hammond authored
Wrap the annotation directive tests in a new top-level describe that's for the entire file annotation.js, not just AnnotationController or the annotation directive.
-
Robert Knight authored
Refactor annotation controller, part 1
-
Sean Hammond authored
Move scope.feature() from the annotation directive to vm.feature() in the AnnotationController. Just trying to move as much as possible out of the directive's scope and link function into the controller, if we're gonna use a directive controller here try to just use it instead of randomly using the link function and scope for some things and the controller for others.
-
Sean Hammond authored
It doesn't appear to be possible for model to be null.
-
Sean Hammond authored
-
Sean Hammond authored
Move the DOM event listener function that saves an annotation on Ctrl+Enter into AnnotationController. This is just for the sake of keeping all the code in one place (in AnnotationController, not in the directive's link function) and putting code where it can be tested more easily. Note that the controller's save() function was previously called with scope.$evalAsync() and we're now just calling it synchronously. This seems to be fine.
-
Sean Hammond authored
Remove AnnotationController's vm.preview as it doesn't appear to be used.
-
Sean Hammond authored
Replace AnnotationController's vm.editing boolean with a vm.editing() method. This removes some duplicated state, as both vm.editing and vm.action were recording whether or not the annotation was being edited.
-
Sean Hammond authored
Move scope.share() from the annotation directive to vm.share() in the AnnotationController. Just trying to move as much as possible out of the directive's scope and link function into the controller, if we're gonna use a directive controller here try to just use it instead of randomly using the link function and scope for some things and the controller for others.
-
Sean Hammond authored
It does not change after directive linking, there's no reason to $observe() it.
-
- 02 Dec, 2015 21 commits
-
-
Robert Knight authored
Translate annotation.coffee to JavaScript
-
Sean Hammond authored
-
Sean Hammond authored
-
Sean Hammond authored
-
Sean Hammond authored
-
Sean Hammond authored
-
Sean Hammond authored
-
Sean Hammond authored
Fixes a bug that crept in during the annotation.coffee -> annotation.js translation.
-
Sean Hammond authored
-
Sean Hammond authored
-
Sean Hammond authored
Declare variables on the same line where they're first defined, instead of at the top of the function.
-
Sean Hammond authored
-
Sean Hammond authored
-
Sean Hammond authored
-
Sean Hammond authored
-
Sean Hammond authored
-
Sean Hammond authored
-
Sean Hammond authored
-
Sean Hammond authored
This is a translation of commit 363134d28cb7ff8d2313278e1b4b6c09b5bf9bed from CoffeeScript to JavaScript. Original commit message from 363134d28cb7ff8d2313278e1b4b6c09b5bf9bed: When saving a draft to the drafts store, don't save changes for fields which aren't actually set. This prevents us from accidentally later restoring `null` to one of these fields. Fixes an issue where creating an annotation when logged-out would result in a null permissions field.
-
Sean Hammond authored
These were lost when translating annotation-test.coffee -> annotation-test.js using the `coffee` command.
-
Sean Hammond authored
Tidy up the CoffeeScript-generated code in annotation-test.js.
-