trafficcontrol-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From raw...@apache.org
Subject [trafficcontrol] branch 4.0.x updated: unregisters resize event handler when navigating away from dashboard (#4233) (#4264)
Date Wed, 08 Jan 2020 16:54:47 GMT
This is an automated email from the ASF dual-hosted git repository.

rawlin pushed a commit to branch 4.0.x
in repository https://gitbox.apache.org/repos/asf/trafficcontrol.git


The following commit(s) were added to refs/heads/4.0.x by this push:
     new 725ffa6  unregisters resize event handler when navigating away from dashboard (#4233)
(#4264)
725ffa6 is described below

commit 725ffa6af3001593033399ad2a219855f5039b94
Author: Jeremy Mitchell <mitchell852@users.noreply.github.com>
AuthorDate: Wed Jan 8 09:54:35 2020 -0700

    unregisters resize event handler when navigating away from dashboard (#4233) (#4264)
    
    (cherry picked from commit f91bf53ae21ff45e6e0cbf69cc5470d357c5eab9)
---
 .../app/src/common/modules/chart/bps/ChartBPSController.js         | 7 ++++++-
 .../common/modules/chart/httpStatus/ChartHttpStatusController.js   | 7 ++++++-
 .../app/src/common/modules/chart/tps/ChartTPSController.js         | 7 ++++++-
 .../src/common/modules/widget/cdnChart/WidgetCDNChartController.js | 7 ++++++-
 4 files changed, 24 insertions(+), 4 deletions(-)

diff --git a/traffic_portal/app/src/common/modules/chart/bps/ChartBPSController.js b/traffic_portal/app/src/common/modules/chart/bps/ChartBPSController.js
index 16b27ff..827d79f 100644
--- a/traffic_portal/app/src/common/modules/chart/bps/ChartBPSController.js
+++ b/traffic_portal/app/src/common/modules/chart/bps/ChartBPSController.js
@@ -128,7 +128,11 @@ var ChartBPSController = function(deliveryService, $scope, $state, $timeout,
$fi
 	};
 
 	var registerResizeListener = function() {
-		$(window).resize(plotChart);
+		$(window).bind("resize", plotChart);
+	};
+
+	var unregisterResizeListener = function() {
+		$(window).unbind("resize", plotChart);
 	};
 
 	var plotChart = function() {
@@ -147,6 +151,7 @@ var ChartBPSController = function(deliveryService, $scope, $state, $timeout,
$fi
 
 	$scope.$on("$destroy", function() {
 		killIntervals();
+		unregisterResizeListener();
 	});
 
 	angular.element(document).ready(function () {
diff --git a/traffic_portal/app/src/common/modules/chart/httpStatus/ChartHttpStatusController.js
b/traffic_portal/app/src/common/modules/chart/httpStatus/ChartHttpStatusController.js
index fc0a689..af2981a 100644
--- a/traffic_portal/app/src/common/modules/chart/httpStatus/ChartHttpStatusController.js
+++ b/traffic_portal/app/src/common/modules/chart/httpStatus/ChartHttpStatusController.js
@@ -160,7 +160,11 @@ var ChartHttpStatusController = function(deliveryService, $scope, $state,
$timeo
 	};
 
 	var registerResizeListener = function() {
-		$(window).resize(plotChart);
+		$(window).bind("resize", plotChart);
+	};
+
+	var unregisterResizeListener = function() {
+		$(window).unbind("resize", plotChart);
 	};
 
 	var plotChart = function() {
@@ -180,6 +184,7 @@ var ChartHttpStatusController = function(deliveryService, $scope, $state,
$timeo
 
 	$scope.$on("$destroy", function() {
 		killIntervals();
+		unregisterResizeListener();
 	});
 
 	angular.element(document).ready(function () {
diff --git a/traffic_portal/app/src/common/modules/chart/tps/ChartTPSController.js b/traffic_portal/app/src/common/modules/chart/tps/ChartTPSController.js
index cbbbd06..76d0076 100644
--- a/traffic_portal/app/src/common/modules/chart/tps/ChartTPSController.js
+++ b/traffic_portal/app/src/common/modules/chart/tps/ChartTPSController.js
@@ -128,7 +128,11 @@ var ChartTPSController = function(deliveryService, $scope, $state, $timeout,
$fi
 	};
 
 	var registerResizeListener = function() {
-		$(window).resize(plotChart);
+		$(window).bind("resize", plotChart);
+	};
+
+	var unregisterResizeListener = function() {
+		$(window).unbind("resize", plotChart);
 	};
 
 	var plotChart = function() {
@@ -147,6 +151,7 @@ var ChartTPSController = function(deliveryService, $scope, $state, $timeout,
$fi
 
 	$scope.$on("$destroy", function() {
 		killIntervals();
+		unregisterResizeListener();
 	});
 
 	angular.element(document).ready(function () {
diff --git a/traffic_portal/app/src/common/modules/widget/cdnChart/WidgetCDNChartController.js
b/traffic_portal/app/src/common/modules/widget/cdnChart/WidgetCDNChartController.js
index cefc93c..b7beb49 100644
--- a/traffic_portal/app/src/common/modules/widget/cdnChart/WidgetCDNChartController.js
+++ b/traffic_portal/app/src/common/modules/widget/cdnChart/WidgetCDNChartController.js
@@ -168,7 +168,11 @@ var WidgetCDNChartController = function(cdn, $scope, $timeout, $filter,
$q, $int
 	};
 
 	var registerResizeListener = function() {
-		$(window).resize(plotChart);
+		$(window).bind("resize", plotChart);
+	};
+
+	var unregisterResizeListener = function() {
+		$(window).unbind("resize", plotChart);
 	};
 
 	var plotChart = function() {
@@ -187,6 +191,7 @@ var WidgetCDNChartController = function(cdn, $scope, $timeout, $filter,
$q, $int
 
 	$scope.$on("$destroy", function() {
 		killIntervals();
+		unregisterResizeListener();
 	});
 
 	angular.element(document).ready(function () {


Mime
View raw message