1. 14 Dec, 2015 6 commits
    • Sean Hammond's avatar
      Don't use vm.annotation.permissions · e149a3e3
      Sean Hammond authored
      The templates read vm.isPrivate() and vm.isShared() and call vm.setPrivacy()
      so vm.annotation.permissions just isn't needed.
      
      The controller modifies domainModel.permissions when the permissions need to
      change.
      
      vm.annotation.permissions is still there, we just don't use it anymore, in the
      future we should not copy it into vm.annotation at all.
      e149a3e3
    • Sean Hammond's avatar
      Don't use vm.annotation.group · 205efe04
      Sean Hammond authored
      The templates read vm.group() (which returns domainModel.group) and never write
      any group, so vm.annotation.group just isn't needed.
      
      The controller modifies domainModel.group is the focused group changes while
      creating a new annotation.
      
      vm.annotation.group is still there, we just don't use it anymore, in the future
      we should not copy it into vm.annotation at all.
      205efe04
    • Sean Hammond's avatar
      Rename model -> domainModel · 9cce6a0b
      Sean Hammond authored
      9cce6a0b
    • Sean Hammond's avatar
      Rename viewModel -> vm · 8925ff91
      Sean Hammond authored
      8925ff91
    • Sean Hammond's avatar
      Remove some code duplication · 47d9024d
      Sean Hammond authored
      Clarify the pattern of using the presence or not of model.id to test
      whether an annotation is new in AnnotationController.
      47d9024d
    • Sean Hammond's avatar
      Don't change model.group on group change · 2f5b8bc1
      Sean Hammond authored
      Don't change model.group in AnnotationController when the currently focused
      group changes.
      
      model is supposed to be a read-only domain model, change vm.annotation instead.
      
      Changes to vm.annotation are copied over to model before saving model to the
      server.
      
      To make this work vm.group() should return the current group of the annotation,
      accounting for any changes made to vm.annotation but not saved to model or to
      the server yet. It should return vm.annotation.group not model.group.
      
      Similarly vm.isShared() should be based on vm.annotation not on model.
      
      Also remove some code in thread.coffee that was deliberately hiding new
      annotations that don't belong to the focused group (see commit
      272b2432c48a2d6bf890daa863e92f3a678b27b5). This is no longer the desired
      behaviour - when changing groups any new annotations move to the new group with
      us (and the GROUP_FOCUSED listener in AnnotationController will update
      vm.annotation.group to match).
      2f5b8bc1
  2. 11 Dec, 2015 28 commits
  3. 10 Dec, 2015 6 commits