##// END OF EJS Templates
dashboard: reintroduce scope.destroy()
ergo -
Show More
@@ -8859,10 +8859,12 b' function IndexDashboardController($rootScope, $scope, $location, $cookies, $inte'
8859 $location.search('timespan', vm.timeSpan.key);
8859 $location.search('timespan', vm.timeSpan.key);
8860 $location.search('graphtype', vm.graphType.selected);
8860 $location.search('graphtype', vm.graphType.selected);
8861 stateHolder.resource = vm.resource;
8861 stateHolder.resource = vm.resource;
8862
8862 if (vm.resource){
8863 if (vm.resource){
8863 $cookies.putObject('resource', vm.resource,
8864 $cookies.putObject('resource', vm.resource,
8864 {expires:new Date(3000, 1, 1)});
8865 {expires:new Date(3000, 1, 1)});
8865 }
8866 }
8867 vm.refreshData();
8866 };
8868 };
8867
8869
8868 vm.refreshData = function () {
8870 vm.refreshData = function () {
@@ -8878,7 +8880,7 b' function IndexDashboardController($rootScope, $scope, $location, $cookies, $inte'
8878 vm.refreshData();
8880 vm.refreshData();
8879 };
8881 };
8880
8882
8881 var intervalId = $interval(function () {
8883 vm.intervalId = $interval(function () {
8882 if (_.contains(['30m', "1h"], vm.timeSpan.key)) {
8884 if (_.contains(['30m', "1h"], vm.timeSpan.key)) {
8883 // don't do anything if window is unfocused
8885 // don't do anything if window is unfocused
8884 if(document.hidden === true){
8886 if(document.hidden === true){
@@ -9065,6 +9067,10 b' function IndexDashboardController($rootScope, $scope, $location, $cookies, $inte'
9065 );
9067 );
9066 };
9068 };
9067
9069
9070 $scope.$on('$destroy',function(){
9071 $interval.cancel(vm.intervalId);
9072 });
9073
9068 if (stateHolder.AeUser.applications.length){
9074 if (stateHolder.AeUser.applications.length){
9069 vm.show_dashboard = true;
9075 vm.show_dashboard = true;
9070 vm.determineStartState();
9076 vm.determineStartState();
@@ -444,10 +444,12 b' function IndexDashboardController($rootScope, $scope, $location, $cookies, $inte'
444 $location.search('timespan', vm.timeSpan.key);
444 $location.search('timespan', vm.timeSpan.key);
445 $location.search('graphtype', vm.graphType.selected);
445 $location.search('graphtype', vm.graphType.selected);
446 stateHolder.resource = vm.resource;
446 stateHolder.resource = vm.resource;
447
447 if (vm.resource){
448 if (vm.resource){
448 $cookies.putObject('resource', vm.resource,
449 $cookies.putObject('resource', vm.resource,
449 {expires:new Date(3000, 1, 1)});
450 {expires:new Date(3000, 1, 1)});
450 }
451 }
452 vm.refreshData();
451 };
453 };
452
454
453 vm.refreshData = function () {
455 vm.refreshData = function () {
@@ -463,7 +465,7 b' function IndexDashboardController($rootScope, $scope, $location, $cookies, $inte'
463 vm.refreshData();
465 vm.refreshData();
464 };
466 };
465
467
466 var intervalId = $interval(function () {
468 vm.intervalId = $interval(function () {
467 if (_.contains(['30m', "1h"], vm.timeSpan.key)) {
469 if (_.contains(['30m', "1h"], vm.timeSpan.key)) {
468 // don't do anything if window is unfocused
470 // don't do anything if window is unfocused
469 if(document.hidden === true){
471 if(document.hidden === true){
@@ -650,6 +652,10 b' function IndexDashboardController($rootScope, $scope, $location, $cookies, $inte'
650 );
652 );
651 };
653 };
652
654
655 $scope.$on('$destroy',function(){
656 $interval.cancel(vm.intervalId);
657 });
658
653 if (stateHolder.AeUser.applications.length){
659 if (stateHolder.AeUser.applications.length){
654 vm.show_dashboard = true;
660 vm.show_dashboard = true;
655 vm.determineStartState();
661 vm.determineStartState();
General Comments 0
You need to be logged in to leave comments. Login now