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 }}" <a bo-href-i="/repository/{{ repository.namespace }}/{{ repository.name }}/image/{{ imageId }}"
class="image-link-element">{{ imageId.substr(0, 12) }}</a> class="image-link-element" bindonce>{{ imageId.substr(0, 12) }}</a>

View file

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