зеркало из https://github.com/mozilla/treeherder.git
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:
Родитель
62ee77feb3
Коммит
ce7623a6be
|
@ -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();
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче