mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Merge branch 'master' into filtering_overhaul
Conflicts: src/app/controllers/dashboardNavCtrl.js
This commit is contained in:
commit
c4a4ecfc81
@ -15,6 +15,7 @@
|
|||||||
- [Issue #277](https://github.com/grafana/grafana/issues/277). Dashboard: Fix for timepicker date & tooltip when UTC timezone selected.
|
- [Issue #277](https://github.com/grafana/grafana/issues/277). Dashboard: Fix for timepicker date & tooltip when UTC timezone selected.
|
||||||
- [Issue #699](https://github.com/grafana/grafana/issues/699). Dashboard: Fix for bug when adding rows from dashboard settings dialog.
|
- [Issue #699](https://github.com/grafana/grafana/issues/699). Dashboard: Fix for bug when adding rows from dashboard settings dialog.
|
||||||
- [Issue #723](https://github.com/grafana/grafana/issues/723). Dashboard: Fix for hide controls setting not used/initialized on dashboard load
|
- [Issue #723](https://github.com/grafana/grafana/issues/723). Dashboard: Fix for hide controls setting not used/initialized on dashboard load
|
||||||
|
- [Issue #724](https://github.com/grafana/grafana/issues/724). Dashboard: Fix for zoom out causing right hand "to" range to be set in the future.
|
||||||
|
|
||||||
**Tech**
|
**Tech**
|
||||||
- Upgraded from angularjs 1.1.5 to 1.3 beta 17;
|
- Upgraded from angularjs 1.1.5 to 1.3 beta 17;
|
||||||
|
@ -23,6 +23,7 @@ function (angular, _, moment, config, store) {
|
|||||||
$scope.onAppEvent('zoom-out', function() {
|
$scope.onAppEvent('zoom-out', function() {
|
||||||
$scope.zoom(2);
|
$scope.zoom(2);
|
||||||
});
|
});
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.set_default = function() {
|
$scope.set_default = function() {
|
||||||
@ -112,23 +113,23 @@ function (angular, _, moment, config, store) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
$scope.zoom = function(factor) {
|
$scope.zoom = function(factor) {
|
||||||
var _range = timeSrv.timeRange();
|
var range = timeSrv.timeRange();
|
||||||
var _timespan = (_range.to.valueOf() - _range.from.valueOf());
|
|
||||||
var _center = _range.to.valueOf() - _timespan/2;
|
|
||||||
|
|
||||||
var _to = (_center + (_timespan*factor)/2);
|
var timespan = (range.to.valueOf() - range.from.valueOf());
|
||||||
var _from = (_center - (_timespan*factor)/2);
|
var center = range.to.valueOf() - timespan/2;
|
||||||
|
|
||||||
// If we're not already looking into the future, don't.
|
var to = (center + (timespan*factor)/2);
|
||||||
if(_to > Date.now() && _range.to < Date.now()) {
|
var from = (center - (timespan*factor)/2);
|
||||||
var _offset = _to - Date.now();
|
|
||||||
_from = _from - _offset;
|
if(to > Date.now() && range.to <= Date.now()) {
|
||||||
_to = Date.now();
|
var offset = to - Date.now();
|
||||||
|
from = from - offset;
|
||||||
|
to = Date.now();
|
||||||
}
|
}
|
||||||
|
|
||||||
timeSrv.setTime({
|
$scope.filter.setTime({
|
||||||
from:moment.utc(_from).toDate(),
|
from:moment.utc(from).toDate(),
|
||||||
to:moment.utc(_to).toDate(),
|
to:moment.utc(to).toDate(),
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user