Commit d72272ef authored by Robert Knight's avatar Robert Knight

Use one-time bindings in annotation templates for immutable expressions

Use one-time bindings in the annotation component's template
for expressions whose values cannot change during the lifetime
of an annotation card.

Testing using the default /stream view, without scrolling:

Initial status as of 1ceb5fcefd7fa057bdbcf1f73df57d007289531f averaged
over 30+ digest cycles:

 Digest cycle: ~30ms
 Watchers: 1686

With this commit:

 Digest cycle: ~26ms
 Watchers: 1649
parent 1a3d7e0d
......@@ -9,7 +9,7 @@
<span>
<a class="annotation-user"
target="_blank"
ng-href="{{vm.baseURI}}u/{{vm.user()}}"
ng-href="{{::vm.baseURI}}u/{{vm.user()}}"
>{{vm.user() | persona}}</a>
</span>
......@@ -33,11 +33,11 @@
<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 class="annotation-citation"
ng-bind-html="vm.document() | documentTitle"
ng-if="!vm.isSidebar">
ng-if="::!vm.isSidebar">
</span>
<span class="annotation-citation-domain"
ng-bind-html="vm.document() | documentDomain"
ng-if="!vm.isSidebar">
ng-if="::!vm.isSidebar">
</span>
</span>
</span>
......@@ -49,7 +49,7 @@
target="_blank"
title="{{vm.updated() | moment:'LLLL'}}"
ng-if="!vm.editing() && vm.updated()"
ng-href="{{vm.baseURI}}a/{{vm.id()}}"
ng-href="{{::vm.baseURI}}a/{{vm.id()}}"
>{{vm.timestamp}}</a>
</header>
......
......@@ -15,7 +15,7 @@
name="annotation"
annotation="vm.container.message"
is-last-reply="$last"
is-sidebar="isSidebar"
is-sidebar="::isSidebar"
annotation-show-reply-count="{{vm.shouldShowNumReplies()}}"
annotation-reply-count="{{vm.numReplies()}}"
annotation-reply-count-click="vm.toggleCollapsed()"
......
......@@ -2,7 +2,7 @@
!-->
<div class="top-bar" ng-class="frame.visible && 'shown'" ng-cloak>
<!-- Legacy design for top bar, as used in the stream !-->
<div class="top-bar__inner content" ng-if="!isSidebar">
<div class="top-bar__inner content" ng-if="::!isSidebar">
<simple-search
class="simple-search"
query="searchController.query"
......@@ -23,7 +23,7 @@
The inner div is styled with 'content' to center it in
the stream view.
!-->
<div class="top-bar__inner content" ng-if="isSidebar">
<div class="top-bar__inner content" ng-if="::isSidebar">
<group-list class="group-list" auth="auth"></group-list>
<div class="top-bar__expander"></div>
<simple-search
......
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