From 1ac9d30bebe31dcb4839d6973f0ce4cdf992adb2 Mon Sep 17 00:00:00 2001 From: Colin McLeod Date: Tue, 2 Jun 2015 21:26:44 -0700 Subject: [PATCH] Sort buils menu by ship name --- app/js/directives/directive-header.js | 5 +++++ app/views/_header.html | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/app/js/directives/directive-header.js b/app/js/directives/directive-header.js index e4cd4a6d..1d61b560 100755 --- a/app/js/directives/directive-header.js +++ b/app/js/directives/directive-header.js @@ -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(); + }); } }; }]); \ No newline at end of file diff --git a/app/views/_header.html b/app/views/_header.html index 9cb26ba0..c5a2f809 100755 --- a/app/views/_header.html +++ b/app/views/_header.html @@ -15,9 +15,9 @@ Builds