Change binds on the tags page to bindonce

This makes building the DOM in Angular faster
This commit is contained in:
Joseph Schorr 2015-06-25 16:09:50 -04:00
parent 672e8a5ba9
commit 2ef105dd8c
2 changed files with 24 additions and 21 deletions

View file

@ -1,2 +1,2 @@
<a href="/repository/{{ repository.namespace }}/{{ repository.name }}/image/{{ imageId }}"
class="image-link-element">{{ imageId.substr(0, 12) }}</a>
<a bo-href-i="/repository/{{ repository.namespace }}/{{ repository.name }}/image/{{ imageId }}"
class="image-link-element" bindonce>{{ imageId.substr(0, 12) }}</a>

View file

@ -89,40 +89,41 @@
<tr class="co-checkable-row"
ng-repeat="tag in tags | slice:(50 * options.page):(50 * (options.page + 1))"
ng-class="checkedTags.isChecked(tag, checkedTags.checked) ? 'checked' : ''">
ng-class="checkedTags.isChecked(tag, checkedTags.checked) ? 'checked' : ''"
bindonce>
<td><span class="cor-checkable-item" controller="checkedTags" item="tag"></span></td>
<td><span class="tag-span"><i class="fa fa-tag"></i> {{ tag.name }}</span></td>
<td><span class="tag-span"><i class="fa fa-tag"></i><span bo-text="tag.name"></span></span></td>
<td class="hidden-xs">
<span am-time-ago="tag.last_modified" ng-if="tag.last_modified"></span>
<span ng-if="!tag.last_modified">Unknown</span>
<span am-time-ago="tag.last_modified" bo-if="tag.last_modified"></span>
<span bo-if="!tag.last_modified">Unknown</span>
</td>
<td class="hidden-xs">{{ tag.size | bytes }}</td>
<td class="hidden-xs" bo-text="tag.size | bytes"></td>
<td class="hidden-xs image-id-col">
<span class="image-link" repository="repository" image-id="tag.image_id"></span>
</td>
<td class="hidden-xs image-track" ng-repeat="it in imageTracks">
<span class="image-track-dot" ng-if="it.image_id == tag.image_id"
ng-style="{'borderColor': it.color}" ng-click="selectTrack(it)"></span>
<span class="image-track-line" ng-class="trackLineClass($parent.$index, it)"
ng-style="{'borderColor': it.color}"></span>
<td class="hidden-xs image-track" ng-repeat="it in imageTracks" bindonce>
<span class="image-track-dot" bo-if="it.image_id == tag.image_id"
bo-style="{'borderColor': it.color}" ng-click="selectTrack(it)"></span>
<span class="image-track-line" bo-class="trackLineClass($parent.$index, it)"
bo-style="{'borderColor': it.color}"></span>
</td>
<td class="options-col">
<i class="fa fa-download" data-title="Fetch Tag" bs-tooltip
ng-click="fetchTagActionHandler.askFetchTag(tag)">
</i>
</td>
<td class="options-col" ng-if="repository.can_write">
<td class="options-col" bo-if="repository.can_write">
<div class="dropdown" style="text-align: left;">
<i class="fa fa-history dropdown-toggle" data-toggle="dropdown" data-title="Tag History"
ng-click="loadTagHistory(tag)"
bs-tooltip></i>
<ul class="dropdown-menu pull-right">
<li ng-if="!tagHistory[tag.name]"><div class="cor-loader"></div></li>
<li class="tag-image-history-item" ng-repeat="entry in tagHistory[tag.name]">
<li class="tag-image-history-item" ng-repeat="entry in tagHistory[tag.name]" bindonce>
<a href="javascript:void(0)" ng-click="askRevertTag(tag, entry.docker_image_id)">
<div class="image-id">
<i class="fa fa-circle-o"
ng-style="{'color': imageMap[entry.docker_image_id].color || '#eee'}"></i>
bo-style="{'color': imageMap[entry.docker_image_id].color || '#eee'}"></i>
{{ entry.docker_image_id.substr(0, 12) }}
</div>
<div class="image-apply-time">
@ -134,7 +135,8 @@
</div>
</td>
<td class="options-col">
<span class="cor-options-menu" ng-if="repository.can_write">
<span bo-if="repository.can_write">
<span class="cor-options-menu">
<span class="cor-option" option-click="askAddTag(tag)">
<i class="fa fa-plus"></i> Add New Tag
</span>
@ -142,6 +144,7 @@
<i class="fa fa-times"></i> Delete Tag
</span>
</span>
</span>
</td>
</tr>
</table>