Sort nodes on name if set, otherwise ID (fixes #119)
This commit is contained in:
parent
7e5b350096
commit
935a8eb9a7
@ -54,11 +54,10 @@ syncthing.controller('SyncthingCtrl', function ($scope, $http) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function nodeCompare(a, b) {
|
function nodeCompare(a, b) {
|
||||||
if (a.NodeID === $scope.myID) {
|
if (typeof a.Name !== 'undefined' && typeof b.Name !== 'undefined') {
|
||||||
return -1;
|
if (a.Name < b.Name)
|
||||||
}
|
return -1;
|
||||||
if (b.NodeID === $scope.myID) {
|
return a.Name > b.Name;
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
if (a.NodeID < b.NodeID) {
|
if (a.NodeID < b.NodeID) {
|
||||||
return -1;
|
return -1;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user