Bind bufferlist only once where possible

This commit is contained in:
Lorenz H-S 2013-12-28 16:58:32 +01:00
parent 5ac2d6dce1
commit b88b046222
2 changed files with 6 additions and 6 deletions

View File

@ -266,9 +266,9 @@ $ openssl req -nodes -newkey rsa:2048 -keyout relay.pem -x509 -days 365 -out rel
</li> </li>
<li class="buffer" ng-class="{'active': content.active }" ng-repeat="(key, content) in buffers | toArray | filter:{fullName:search} | filter:hasUnread | orderBy:predicate"> <li class="buffer" ng-class="{'active': content.active }" ng-repeat="(key, content) in buffers | toArray | filter:{fullName:search} | filter:hasUnread | orderBy:predicate">
<a href="#" ng-click="setActiveBuffer(content.id)" title="{{ content.fullName }}"> <a href="#" ng-click="setActiveBuffer(content.id)" title="{{ content.fullName }}">
<span class="badge pull-right" ng-hide="content.notification" ng-if="content.unread" ng-bind="content.unread"></span> <span class="badge pull-right" ng-hide="content.notification" ng-if="content.unread" ng-bind="content.unread"></span>
<span class="badge pull-right danger" ng-show="content.notification" ng-bind="content.notification"></span> <span class="badge pull-right danger" ng-show="content.notification" ng-bind="content.notification"></span>
{{ content.indent(predicate) }}{{ content.shortName }}<span ng-hide="content.shortName">{{ content.fullName }}</span> {{ content.indentedName(predicate) }}<span ng-hide="content.shortName">{{ content.fullName }}</span>
</a> </a>
</li> </li>
</ul> </ul>

View File

@ -28,12 +28,12 @@ models.service('models', ['$rootScope', '$filter', function($rootScope, $filter)
var lastSeen = -1; var lastSeen = -1;
var serverSortKey = fullName.replace(/^irc.server.(\w+)/, "irc.$1"); var serverSortKey = fullName.replace(/^irc.server.(\w+)/, "irc.$1");
var indent = function(predicate) { var indentedName = function(predicate) {
if( predicate == "serverSortKey" && fullName.match(/^irc./) && !fullName.match(/^irc.server./) ) { if( predicate == "serverSortKey" && fullName.match(/^irc./) && !fullName.match(/^irc.server./) ) {
// indent channel // indent channel
return "    "; // four protected spaces return "    " + shortName; // four protected spaces
} else { } else {
return ""; return shortName;
} }
}; };
@ -173,7 +173,7 @@ models.service('models', ['$rootScope', '$filter', function($rootScope, $filter)
updateNick: updateNick, updateNick: updateNick,
flatNicklist: flatNicklist, flatNicklist: flatNicklist,
serverSortKey: serverSortKey, serverSortKey: serverSortKey,
indent: indent, indentedName: indentedName,
history: history, history: history,
addToHistory: addToHistory, addToHistory: addToHistory,
getHistoryUp: getHistoryUp, getHistoryUp: getHistoryUp,