mirror of
https://github.com/EDCD/coriolis.git
synced 2025-12-10 07:05:35 +00:00
Sort buils menu by ship name
This commit is contained in:
@@ -8,6 +8,7 @@ angular.module('app').directive('shipyardHeader', ['lodash', '$rootScope', 'Pers
|
|||||||
scope.openedMenu = null;
|
scope.openedMenu = null;
|
||||||
scope.ships = ships;
|
scope.ships = ships;
|
||||||
scope.allBuilds = Persist.builds;
|
scope.allBuilds = Persist.builds;
|
||||||
|
scope.buildsList = Object.keys(scope.allBuilds).sort();
|
||||||
scope.allComparisons = Persist.comparisons;
|
scope.allComparisons = Persist.comparisons;
|
||||||
scope.bs = Persist.state;
|
scope.bs = Persist.state;
|
||||||
|
|
||||||
@@ -65,6 +66,10 @@ angular.module('app').directive('shipyardHeader', ['lodash', '$rootScope', 'Pers
|
|||||||
$rootScope.hideAbout = function (){
|
$rootScope.hideAbout = function (){
|
||||||
$rootScope.showAbout = false;
|
$rootScope.showAbout = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
scope.$watchCollection('allBuilds', function() {
|
||||||
|
scope.buildsList = Object.keys(scope.allBuilds).sort();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}]);
|
}]);
|
||||||
@@ -15,9 +15,9 @@
|
|||||||
<svg class="icon warning" ng-class="{'warning-disabled': !bs.hasBuilds}"><use xlink:href="#hammer"></use></svg> Builds
|
<svg class="icon warning" ng-class="{'warning-disabled': !bs.hasBuilds}"><use xlink:href="#hammer"></use></svg> Builds
|
||||||
</div>
|
</div>
|
||||||
<div class="menu-list dbl" ng-if="openedMenu=='b'" ng-click="$event.stopPropagation();">
|
<div class="menu-list dbl" ng-if="openedMenu=='b'" ng-click="$event.stopPropagation();">
|
||||||
<ul class="l" ng-repeat="(shipId,builds) in allBuilds">
|
<ul class="l" ng-repeat="shipId in buildsList">
|
||||||
{{ships[shipId].properties.name}}
|
{{ships[shipId].properties.name}}
|
||||||
<li ng-repeat="(name, build) in builds">
|
<li ng-repeat="(name, build) in allBuilds[shipId]">
|
||||||
<a ui-sref-active="active" class="name" ui-sref="outfit({shipId:shipId, code:build, bn:name})" ng-bind="name"></a>
|
<a ui-sref-active="active" class="name" ui-sref="outfit({shipId:shipId, code:build, bn:name})" ng-bind="name"></a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|||||||
Reference in New Issue
Block a user