=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dashboard/dashboard-controller.js' --- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dashboard/dashboard-controller.js 2015-02-18 13:00:15 +0000 +++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dashboard/dashboard-controller.js 2015-02-18 13:12:41 +0000 @@ -184,6 +184,10 @@ $scope.orderChanged = true; } } + + if($scope.orderChanged){ + saveDashboardLayout(); + } } }); @@ -215,27 +219,15 @@ $scope.removeWidget = function(widget){ widget.show = false; - trackWidgetStatusChange(widget); + saveDashboardLayout(); }; $scope.expandCollapse = function(widget){ widget.expand = !widget.expand; - trackWidgetStatusChange(widget); - }; - - var trackWidgetStatusChange = function(widget){ - var w = $scope.dashboardStatus[widget.title]; - - if(!angular.equals(w, widget) && $scope.widgetsChanged.indexOf(widget.title) === -1){ - $scope.widgetsChanged.push(widget.title); - } - if(angular.equals(w, widget) && $scope.widgetsChanged.indexOf(widget.title) !== -1){ - var idx = $scope.widgetsChanged.indexOf(widget.title); - $scope.widgetsChanged.splice(idx,1); - } - }; - - $scope.saveDashboardLayout = function(){ + saveDashboardLayout();; + }; + + var saveDashboardLayout = function(){ var widgets = []; angular.forEach($rootScope.dashboardWidgets, function(widget){ var w = angular.copy(widget); @@ -257,15 +249,7 @@ $scope.dashboardLayouts[$scope.selectedProgram.id] = {widgets: widgets, program: $scope.selectedProgram.id}; } - DashboardLayoutService.saveLayout($scope.dashboardLayouts).then(function(){ - if($scope.selectedProgramId && $scope.selectedProgram && $scope.selectedProgramId === $scope.selectedProgram.id || - !$scope.selectedProgramId && !$scope.selectedProgram){ - $route.reload(); - } - else{ - $location.path('/dashboard').search({tei: $scope.selectedTeiId, - program: $scope.selectedProgram ? $scope.selectedProgram.id: null}); - } + DashboardLayoutService.saveLayout($scope.dashboardLayouts).then(function(){ }); }; @@ -280,6 +264,6 @@ }; $rootScope.closeOpenWidget = function(widget){ - trackWidgetStatusChange(widget); + saveDashboardLayout(); }; }); === modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dashboard/dashboard-widgets.html' --- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dashboard/dashboard-widgets.html 2015-02-06 20:22:45 +0000 +++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dashboard/dashboard-widgets.html 2015-02-18 13:12:41 +0000 @@ -1,32 +1,3 @@ - - === modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dashboard/dashboard.html' --- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dashboard/dashboard.html 2015-02-09 17:04:31 +0000 +++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dashboard/dashboard.html 2015-02-18 13:12:41 +0000 @@ -12,9 +12,6 @@
- - {{'dashboard_layout_not_saved'| translate}} -