Sort buils menu by ship name

This commit is contained in:
Colin McLeod
2015-06-02 21:26:44 -07:00
parent 4040767427
commit 1ac9d30beb
2 changed files with 7 additions and 2 deletions

View File

@@ -8,6 +8,7 @@ angular.module('app').directive('shipyardHeader', ['lodash', '$rootScope', 'Pers
scope.openedMenu = null;
scope.ships = ships;
scope.allBuilds = Persist.builds;
scope.buildsList = Object.keys(scope.allBuilds).sort();
scope.allComparisons = Persist.comparisons;
scope.bs = Persist.state;
@@ -65,6 +66,10 @@ angular.module('app').directive('shipyardHeader', ['lodash', '$rootScope', 'Pers
$rootScope.hideAbout = function (){
$rootScope.showAbout = false;
};
scope.$watchCollection('allBuilds', function() {
scope.buildsList = Object.keys(scope.allBuilds).sort();
});
}
};
}]);