From a1ed3ae0943fb54c7af4ab156beaf1c883300685 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Tue, 14 Aug 2018 12:25:19 +0200 Subject: [PATCH] feat: add auto fit panels to shortcut modal, closes #12768 --- public/app/core/components/help/help.ts | 1 + public/app/core/services/keybindingSrv.ts | 15 +++------------ 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/public/app/core/components/help/help.ts b/public/app/core/components/help/help.ts index a1d3c34ae5b..eac47b6e0a2 100644 --- a/public/app/core/components/help/help.ts +++ b/public/app/core/components/help/help.ts @@ -25,6 +25,7 @@ export class HelpCtrl { { keys: ['d', 'k'], description: 'Toggle kiosk mode (hides top nav)' }, { keys: ['d', 'E'], description: 'Expand all rows' }, { keys: ['d', 'C'], description: 'Collapse all rows' }, + { keys: ['d', 'a'], description: 'Toggle auto fit panels (experimental feature)' }, { keys: ['mod+o'], description: 'Toggle shared graph crosshair' }, ], 'Focused Panel': [ diff --git a/public/app/core/services/keybindingSrv.ts b/public/app/core/services/keybindingSrv.ts index f740718063c..9d914a94a1c 100644 --- a/public/app/core/services/keybindingSrv.ts +++ b/public/app/core/services/keybindingSrv.ts @@ -15,14 +15,7 @@ export class KeybindingSrv { timepickerOpen = false; /** @ngInject */ - constructor( - private $rootScope, - private $location, - private datasourceSrv, - private timeSrv, - private contextSrv, - private $route - ) { + constructor(private $rootScope, private $location, private datasourceSrv, private timeSrv, private contextSrv) { // clear out all shortcuts on route change $rootScope.$on('$routeChangeSuccess', () => { Mousetrap.reset(); @@ -269,10 +262,8 @@ export class KeybindingSrv { //Autofit panels this.bind('d a', () => { - this.$location.search('autofitpanels', this.$location.search().autofitpanels ? null : true); - //Force reload - - this.$route.reload(); + // this has to be a full page reload + window.location.href = window.location.href + '&autofitpanels'; }); } }