mirror of
https://github.com/EDCD/coriolis.git
synced 2025-12-09 22:55:35 +00:00
Linting fixes
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
angular.module('app').directive('shipyardHeader', ['lodash', '$rootScope', 'Persist', 'ShipsDB', function (_, $rootScope, Persist, ships) {
|
||||
angular.module('app').directive('shipyardHeader', ['lodash', '$rootScope', 'Persist', 'ShipsDB', function(_, $rootScope, Persist, ships) {
|
||||
|
||||
return {
|
||||
restrict: 'E',
|
||||
templateUrl: 'views/_header.html',
|
||||
scope: true,
|
||||
link: function (scope) {
|
||||
link: function(scope) {
|
||||
scope.openedMenu = null;
|
||||
scope.ships = ships;
|
||||
scope.allBuilds = Persist.builds;
|
||||
@@ -15,22 +15,22 @@ angular.module('app').directive('shipyardHeader', ['lodash', '$rootScope', 'Pers
|
||||
// Insurance options and management here for now.
|
||||
$rootScope.insurance = {
|
||||
opts: [
|
||||
{ name:'Standard', pct: 0.05 },
|
||||
{ name:'Alpha', pct: 0.025 },
|
||||
{ name:'Beta', pct: 0.035 }
|
||||
{ name: 'Standard', pct: 0.05 },
|
||||
{ name: 'Alpha', pct: 0.025 },
|
||||
{ name: 'Beta', pct: 0.035 }
|
||||
]
|
||||
};
|
||||
|
||||
var insIndex = _.findIndex($rootScope.insurance.opts, 'name', Persist.getInsurance());
|
||||
$rootScope.insurance.current = $rootScope.insurance.opts[insIndex != -1? insIndex : 0];
|
||||
$rootScope.insurance.current = $rootScope.insurance.opts[insIndex != -1 ? insIndex : 0];
|
||||
|
||||
// Close menus if a navigation change event occurs
|
||||
$rootScope.$on('$stateChangeStart',function(){
|
||||
$rootScope.$on('$stateChangeStart', function() {
|
||||
scope.openedMenu = null;
|
||||
});
|
||||
|
||||
// Listen to close event to close opened menus or modals
|
||||
$rootScope.$on('close', function () {
|
||||
$rootScope.$on('close', function() {
|
||||
scope.openedMenu = null;
|
||||
$rootScope.showAbout = false;
|
||||
});
|
||||
@@ -38,13 +38,13 @@ angular.module('app').directive('shipyardHeader', ['lodash', '$rootScope', 'Pers
|
||||
/**
|
||||
* Save selected insurance option
|
||||
*/
|
||||
scope.updateInsurance = function(){
|
||||
scope.updateInsurance = function() {
|
||||
Persist.setInsurance($rootScope.insurance.current.name);
|
||||
};
|
||||
|
||||
scope.openMenu = function (e, menu) {
|
||||
scope.openMenu = function(e, menu) {
|
||||
e.stopPropagation();
|
||||
if(menu == scope.openedMenu) {
|
||||
if (menu == scope.openedMenu) {
|
||||
scope.openedMenu = null;
|
||||
return;
|
||||
}
|
||||
@@ -63,7 +63,7 @@ angular.module('app').directive('shipyardHeader', ['lodash', '$rootScope', 'Pers
|
||||
$rootScope.showAbout = true;
|
||||
};
|
||||
|
||||
$rootScope.hideAbout = function (){
|
||||
$rootScope.hideAbout = function() {
|
||||
$rootScope.showAbout = false;
|
||||
};
|
||||
|
||||
@@ -72,4 +72,4 @@ angular.module('app').directive('shipyardHeader', ['lodash', '$rootScope', 'Pers
|
||||
});
|
||||
}
|
||||
};
|
||||
}]);
|
||||
}]);
|
||||
|
||||
Reference in New Issue
Block a user