GUACAMOLE-5: Define sorting weight for GroupListItem.

This commit is contained in:
Michael Jumper
2016-08-05 15:29:26 -07:00
parent 989ad39513
commit 558d242060
2 changed files with 11 additions and 1 deletions

View File

@@ -58,7 +58,7 @@
</div>
<!-- Pager for connections / groups -->
<guac-pager page="childrenPage" items="rootItems | orderBy : 'name'"
<guac-pager page="childrenPage" items="rootItems | orderBy : ['weight', 'name']"
page-size="pageSize"></guac-pager>
</div>

View File

@@ -132,6 +132,16 @@ angular.module('groupList').factory('GroupListItem', ['ConnectionGroup', functio
*/
this.wrappedItem = template.wrappedItem;
/**
* The sorting weight to apply when displaying this GroupListItem. This
* weight is relative only to other sorting weights. If two items have
* the same weight, they will be sorted based on their names.
*
* @type Number
* @default 0
*/
this.weight = template.weight || 0;
};
/**