mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
ux(dashboard): fixes for changing panel tabs, #6442
This commit is contained in:
parent
47aae7f1f2
commit
cdea420285
@ -100,7 +100,10 @@ export class KeybindingSrv {
|
|||||||
this.bind('e', () => {
|
this.bind('e', () => {
|
||||||
if (dashboard.meta.focusPanelId && dashboard.meta.canEdit) {
|
if (dashboard.meta.focusPanelId && dashboard.meta.canEdit) {
|
||||||
this.$rootScope.appEvent('panel-change-view', {
|
this.$rootScope.appEvent('panel-change-view', {
|
||||||
fullscreen: true, edit: true, panelId: dashboard.meta.focusPanelId
|
fullscreen: true,
|
||||||
|
edit: true,
|
||||||
|
panelId: dashboard.meta.focusPanelId,
|
||||||
|
toggle: true
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -108,7 +111,10 @@ export class KeybindingSrv {
|
|||||||
this.bind('v', () => {
|
this.bind('v', () => {
|
||||||
if (dashboard.meta.focusPanelId) {
|
if (dashboard.meta.focusPanelId) {
|
||||||
this.$rootScope.appEvent('panel-change-view', {
|
this.$rootScope.appEvent('panel-change-view', {
|
||||||
fullscreen: true, edit: null, panelId: dashboard.meta.focusPanelId
|
fullscreen: true,
|
||||||
|
edit: null,
|
||||||
|
panelId: dashboard.meta.focusPanelId,
|
||||||
|
toggle: true,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -84,11 +84,14 @@ function (angular, _, $) {
|
|||||||
|
|
||||||
DashboardViewState.prototype.update = function(state) {
|
DashboardViewState.prototype.update = function(state) {
|
||||||
// implement toggle logic
|
// implement toggle logic
|
||||||
|
if (state.toggle) {
|
||||||
|
delete state.toggle;
|
||||||
if (this.state.fullscreen && state.fullscreen) {
|
if (this.state.fullscreen && state.fullscreen) {
|
||||||
if (this.state.edit === state.edit) {
|
if (this.state.edit === state.edit) {
|
||||||
state.fullscreen = !state.fullscreen;
|
state.fullscreen = !state.fullscreen;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// remember if editStateChanged
|
// remember if editStateChanged
|
||||||
this.editStateChanged = state.edit !== this.state.edit;
|
this.editStateChanged = state.edit !== this.state.edit;
|
||||||
@ -163,7 +166,7 @@ function (angular, _, $) {
|
|||||||
if (!render) { return false;}
|
if (!render) { return false;}
|
||||||
|
|
||||||
$timeout(function() {
|
$timeout(function() {
|
||||||
if (self.oldTimeRange && self.oldTimeRange !== ctrl.range) {
|
if (self.oldTimeRange !== ctrl.range) {
|
||||||
self.$scope.broadcastRefresh();
|
self.$scope.broadcastRefresh();
|
||||||
} else {
|
} else {
|
||||||
self.$scope.$broadcast('render');
|
self.$scope.$broadcast('render');
|
||||||
|
@ -111,7 +111,6 @@ export class PanelCtrl {
|
|||||||
changeTab(newIndex) {
|
changeTab(newIndex) {
|
||||||
this.editorTabIndex = newIndex;
|
this.editorTabIndex = newIndex;
|
||||||
var route = this.$injector.get('$route');
|
var route = this.$injector.get('$route');
|
||||||
|
|
||||||
route.current.params.tab = this.editorTabs[newIndex].title.toLowerCase();
|
route.current.params.tab = this.editorTabs[newIndex].title.toLowerCase();
|
||||||
route.updateParams();
|
route.updateParams();
|
||||||
}
|
}
|
||||||
|
@ -247,7 +247,7 @@ a.dash-row-header-actions--tight {
|
|||||||
|
|
||||||
.row-open {
|
.row-open {
|
||||||
margin-top: 1px;
|
margin-top: 1px;
|
||||||
left: -22px;
|
left: -24px;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
z-index: 100;
|
z-index: 100;
|
||||||
transition: .10s left;
|
transition: .10s left;
|
||||||
|
@ -33,9 +33,9 @@ module.exports = function(config, grunt) {
|
|||||||
|
|
||||||
// copy ts file also used by source maps
|
// copy ts file also used by source maps
|
||||||
//changes changed file source to that of the changed file
|
//changes changed file source to that of the changed file
|
||||||
var option = 'typescript.build.src';
|
grunt.config('typescript.build.src', filepath);
|
||||||
var result = filepath;
|
grunt.config('tslint.source.files.src', filepath);
|
||||||
grunt.config(option, result);
|
|
||||||
grunt.task.run('typescript:build');
|
grunt.task.run('typescript:build');
|
||||||
grunt.task.run('tslint');
|
grunt.task.run('tslint');
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user