diff --git a/app/js/controllers/controller-outfit.js b/app/js/controllers/controller-outfit.js index d23e9ef0..4dcbd974 100755 --- a/app/js/controllers/controller-outfit.js +++ b/app/js/controllers/controller-outfit.js @@ -39,7 +39,7 @@ angular.module('app').controller('OutfitController', ['$window', '$rootScope', ' $scope.retroPredicate = 'netCost'; $scope.costDesc = true; $scope.costPredicate = 'c.cost'; - $scope.costTab = 'retrofit'; + $scope.costTab = Persist.getCostTab() || 'costs'; if ($scope.savedCode) { Serializer.toShip(retrofitShip, $scope.savedCode); // Populate components from last save @@ -351,6 +351,11 @@ angular.module('app').controller('OutfitController', ['$window', '$rootScope', ' $scope.retrofitTotal = total; } + $scope.updateCostTab = function (tab) { + Persist.setCostTab(tab); + $scope.costTab = tab; + } + // Hide any open menu/slot/etc if the background is clicked $scope.$on('close', function() { $scope.selectedSlot = null; diff --git a/app/js/service-persist.js b/app/js/service-persist.js index 0158b7d2..cd53e242 100755 --- a/app/js/service-persist.js +++ b/app/js/service-persist.js @@ -204,6 +204,27 @@ angular.module('app').service('Persist', ['$window', 'lodash', function($window, return null; }; + /** + * Persist selected cost tab + * @param {number} val Discount value/amount + */ + this.setCostTab = function(tabName) { + if (this.lsEnabled) { + return localStorage.setItem('costTab', tabName); + } + }; + + /** + * Get the saved discount + * @return {number} val Discount value/amount + */ + this.getCostTab = function() { + if (this.lsEnabled) { + return localStorage.getItem('costTab'); + } + return null; + }; + /** * Retrieve the last router state from local storage * @param {object} state State object containing state name and params diff --git a/app/views/page-outfit.html b/app/views/page-outfit.html index c5d30f2e..10604b0d 100644 --- a/app/views/page-outfit.html +++ b/app/views/page-outfit.html @@ -76,26 +76,6 @@ -
| Retrofit Costs | -Costs | +Retrofit Costs | +Costs |
|---|