Merge pull request #12796 from dehrax/12768-panel-heights

WIP: Fit panels to screen height
This commit is contained in:
Marcus Efraimsson
2018-08-07 15:57:40 +02:00
committed by GitHub
5 changed files with 51 additions and 7 deletions
+16 -1
View File
@@ -15,7 +15,14 @@ export class KeybindingSrv {
timepickerOpen = false;
/** @ngInject */
constructor(private $rootScope, private $location, private datasourceSrv, private timeSrv, private contextSrv) {
constructor(
private $rootScope,
private $location,
private datasourceSrv,
private timeSrv,
private contextSrv,
private $route
) {
// clear out all shortcuts on route change
$rootScope.$on('$routeChangeSuccess', () => {
Mousetrap.reset();
@@ -259,6 +266,14 @@ export class KeybindingSrv {
this.bind('d v', () => {
appEvents.emit('toggle-view-mode');
});
//Autofit panels
this.bind('d a', () => {
this.$location.search('autofitpanels', this.$location.search().autofitpanels ? null : true);
//Force reload
this.$route.reload();
});
}
}