mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
feat: add auto fit panels to shortcut modal, closes #12768
This commit is contained in:
parent
3769df7119
commit
a1ed3ae094
@ -25,6 +25,7 @@ export class HelpCtrl {
|
|||||||
{ keys: ['d', 'k'], description: 'Toggle kiosk mode (hides top nav)' },
|
{ keys: ['d', 'k'], description: 'Toggle kiosk mode (hides top nav)' },
|
||||||
{ keys: ['d', 'E'], description: 'Expand all rows' },
|
{ keys: ['d', 'E'], description: 'Expand all rows' },
|
||||||
{ keys: ['d', 'C'], description: 'Collapse 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' },
|
{ keys: ['mod+o'], description: 'Toggle shared graph crosshair' },
|
||||||
],
|
],
|
||||||
'Focused Panel': [
|
'Focused Panel': [
|
||||||
|
@ -15,14 +15,7 @@ export class KeybindingSrv {
|
|||||||
timepickerOpen = false;
|
timepickerOpen = false;
|
||||||
|
|
||||||
/** @ngInject */
|
/** @ngInject */
|
||||||
constructor(
|
constructor(private $rootScope, private $location, private datasourceSrv, private timeSrv, private contextSrv) {
|
||||||
private $rootScope,
|
|
||||||
private $location,
|
|
||||||
private datasourceSrv,
|
|
||||||
private timeSrv,
|
|
||||||
private contextSrv,
|
|
||||||
private $route
|
|
||||||
) {
|
|
||||||
// clear out all shortcuts on route change
|
// clear out all shortcuts on route change
|
||||||
$rootScope.$on('$routeChangeSuccess', () => {
|
$rootScope.$on('$routeChangeSuccess', () => {
|
||||||
Mousetrap.reset();
|
Mousetrap.reset();
|
||||||
@ -269,10 +262,8 @@ export class KeybindingSrv {
|
|||||||
|
|
||||||
//Autofit panels
|
//Autofit panels
|
||||||
this.bind('d a', () => {
|
this.bind('d a', () => {
|
||||||
this.$location.search('autofitpanels', this.$location.search().autofitpanels ? null : true);
|
// this has to be a full page reload
|
||||||
//Force reload
|
window.location.href = window.location.href + '&autofitpanels';
|
||||||
|
|
||||||
this.$route.reload();
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user