Commit 56682cb1 by Torkel Ödegaard Committed by GitHub

Merge pull request #15850 from grafana/15849-autofitpanels-in-url

Don't add autofitpanels to the url if it already exists
parents 312ce88e f3dbdfac
...@@ -4,6 +4,7 @@ import _ from 'lodash'; ...@@ -4,6 +4,7 @@ import _ from 'lodash';
import coreModule from 'app/core/core_module'; import coreModule from 'app/core/core_module';
import appEvents from 'app/core/app_events'; import appEvents from 'app/core/app_events';
import { getExploreUrl } from 'app/core/utils/explore'; import { getExploreUrl } from 'app/core/utils/explore';
import { store } from 'app/store/store';
import Mousetrap from 'mousetrap'; import Mousetrap from 'mousetrap';
import 'mousetrap-global-bind'; import 'mousetrap-global-bind';
...@@ -294,7 +295,9 @@ export class KeybindingSrv { ...@@ -294,7 +295,9 @@ export class KeybindingSrv {
//Autofit panels //Autofit panels
this.bind('d a', () => { this.bind('d a', () => {
// this has to be a full page reload // this has to be a full page reload
window.location.href = window.location.href + '&autofitpanels'; const queryParams = store.getState().location.query;
const newUrlParam = queryParams.autofitpanels ? '' : '&autofitpanels';
window.location.href = window.location.href + newUrlParam;
}); });
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment