Bug 1203997 - Don't trigger time range changed events when it hasn't changed

This would cause spurious navigation, which caused us to lose state when
loading the graphs view from a URL. This may have also been causing buggy
behaviour with the compare chooser locally.
This commit is contained in:
William Lachance 2015-09-14 17:11:47 -04:00
Родитель 62ee77feb3
Коммит ce7623a6be
1 изменённых файлов: 7 добавлений и 1 удалений

Просмотреть файл

@ -15,7 +15,8 @@ perf.controller('GraphsCtrl', [
$scope.highlightedRevisions = [ undefined, undefined ];
$scope.timeranges = phTimeRanges;
$scope.myTimerange = _.find(phTimeRanges, {'value': parseInt($stateParams.timerange)});
$scope.oldTimerange = _.find(phTimeRanges, {'value': parseInt($stateParams.timerange)});
$scope.myTimerange = $scope.oldTimerange;
$scope.ttHideTimer = null;
$scope.selectedDataPoint = null;
$scope.showToolTipTimeout = null;
@ -424,6 +425,11 @@ perf.controller('GraphsCtrl', [
}
$scope.timeRangeChanged = function() {
// if new === old (i.e. page is first loaded), skip the event
if ($scope.oldTimerange.value === $scope.myTimerange.value) {
return;
}
$scope.zoom = {};
deselectDataPoint();