diff --git a/app/scripts/controllers/account.dashboard.js b/app/scripts/controllers/account.dashboard.js index 049dc155..0be21c9d 100644 --- a/app/scripts/controllers/account.dashboard.js +++ b/app/scripts/controllers/account.dashboard.js @@ -10,9 +10,11 @@ function AccountDashboardController (AccountService, LocalStorageService, $scope) { var vm = this; var localStorageKey = 'osem.dashboard.listStyle'; + var localStorageOrderByKey = 'osem.dashboard.orderBy'; vm.boxes = []; vm.listStyle = 'tiles'; + vm.orderByProperty = 'createdAt'; activate(); @@ -24,6 +26,11 @@ vm.listStyle = listStyleFromLocalStorage; } + var orderByFromLocalStorage = LocalStorageService.getValue(localStorageOrderByKey); + if (orderByFromLocalStorage) { + vm.orderByProperty = orderByFromLocalStorage; + } + return getUsersBoxes() .then(function () { // console.info('Activated Dashboard View'); @@ -43,5 +50,9 @@ $scope.$watch('dashboard.listStyle', function (value) { LocalStorageService.setValue(localStorageKey, value); }); + + $scope.$watch('dashboard.orderByProperty', function (value) { + LocalStorageService.setValue(localStorageOrderByKey, value); + }); } })(); diff --git a/app/views/account.dashboard.html b/app/views/account.dashboard.html index 96e76176..793436d9 100644 --- a/app/views/account.dashboard.html +++ b/app/views/account.dashboard.html @@ -13,7 +13,7 @@

+
+ +
+ + +
-
+
@@ -73,7 +82,7 @@

{{'DASHBOARD_DATAUPLOAD' | translate}}

    -
  • +
  • {{'BOX_NAME' | translate}}: {{box.name}}

    {{'BOX_EXPOSURE' | translate}}: {{box.exposure}}, {{'BOX_MODEL' | translate}}: {{box.model}}