Commit 41904b1b authored by Sean Hammond's avatar Sean Hammond Committed by GitHub

Merge pull request #8 from hypothesis/simplify-annot-cmp

Simplify annotation component by removing duplicated state
parents 9d6f56bc 8db47b83
This diff is collapsed.
......@@ -22,20 +22,20 @@
target="_blank" ng-if="vm.group() && vm.group().url" href="{{vm.group().url}}">
<i class="h-icon-group"></i><span class="annotation-header__group-name">{{vm.group().name}}</span>
</a>
<span ng-show="vm.isPrivate"
<span ng-show="vm.state().isPrivate"
title="This annotation is visible only to you.">
<i class="h-icon-lock"></i><span class="annotation-header__group-name" ng-show="!vm.group().url">Only me</span>
</span>
<i class="h-icon-border-color" ng-show="vm.isHighlight() && !vm.editing()" title="This is a highlight. Click 'edit' to add a note or tag."></i>
<span ng-if="::vm.showDocumentInfo">
<span class="annotation-citation" ng-if="vm.documentMeta.titleLink">
on "<a ng-href="{{vm.documentMeta.titleLink}}">{{vm.documentMeta.titleText}}</a>"
<span class="annotation-citation" ng-if="vm.documentMeta().titleLink">
on "<a ng-href="{{vm.documentMeta().titleLink}}">{{vm.documentMeta().titleText}}</a>"
</span>
<span class="annotation-citation" ng-if="!vm.documentMeta.titleLink">
on "{{vm.documentMeta.titleText}}"
<span class="annotation-citation" ng-if="!vm.documentMeta().titleLink">
on "{{vm.documentMeta().titleText}}"
</span>
<span class="annotation-citation-domain"
ng-if="vm.documentMeta.domain">({{vm.documentMeta.domain}})</span>
ng-if="vm.documentMeta().domain">({{vm.documentMeta().domain}})</span>
</span>
</span>
</span>
......@@ -45,7 +45,7 @@
<timestamp
class-name="'annotation-header__timestamp'"
timestamp="vm.updated()"
href="vm.linkHTML"
href="vm.links().html"
ng-if="!vm.editing() && vm.updated()"></timestamp>
</header>
......@@ -75,8 +75,8 @@
collapse="vm.collapseBody"
collapsed-height="400"
overflow-hysteresis="20"
content-data="vm.form.text">
<markdown text="vm.form.text"
content-data="vm.state().text">
<markdown text="vm.state().text"
on-edit-text="vm.setText(text)"
read-only="!vm.editing()">
</markdown>
......@@ -86,14 +86,14 @@
<!-- Tags -->
<div class="annotation-body form-field" ng-if="vm.editing()">
<tag-editor tags="vm.form.tags"
<tag-editor tags="vm.state().tags"
on-edit-tags="vm.setTags(tags)"></tag-editor>
</div>
<div class="annotation-body u-layout-row tags tags-read-only"
ng-if="(vm.canCollapseBody || vm.form.tags.length) && !vm.editing()">
ng-if="(vm.canCollapseBody || vm.state().tags.length) && !vm.editing()">
<ul class="tag-list">
<li class="tag-item" ng-repeat="tag in vm.form.tags">
<li class="tag-item" ng-repeat="tag in vm.state().tags">
<a ng-href="{{vm.tagStreamURL(tag)}}" target="_blank">{{tag}}</a>
</li>
</ul>
......@@ -170,8 +170,8 @@
</button>
<annotation-share-dialog
group="vm.group()"
uri="vm.linkInContext"
is-private="vm.isPrivate"
uri="vm.links().incontext"
is-private="vm.state().isPrivate"
is-open="vm.showShareDialog"
on-close="vm.showShareDialog = false">
</annotation-share-dialog>
......
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