Skip to content

Commit cdea420

Browse files
committed
ux(dashboard): fixes for changing panel tabs, grafana#6442
1 parent 47aae7f commit cdea420

File tree

5 files changed

+19
-11
lines changed

5 files changed

+19
-11
lines changed

public/app/core/services/keybindingSrv.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,15 +100,21 @@ export class KeybindingSrv {
100100
this.bind('e', () => {
101101
if (dashboard.meta.focusPanelId && dashboard.meta.canEdit) {
102102
this.$rootScope.appEvent('panel-change-view', {
103-
fullscreen: true, edit: true, panelId: dashboard.meta.focusPanelId
103+
fullscreen: true,
104+
edit: true,
105+
panelId: dashboard.meta.focusPanelId,
106+
toggle: true
104107
});
105108
}
106109
});
107110

108111
this.bind('v', () => {
109112
if (dashboard.meta.focusPanelId) {
110113
this.$rootScope.appEvent('panel-change-view', {
111-
fullscreen: true, edit: null, panelId: dashboard.meta.focusPanelId
114+
fullscreen: true,
115+
edit: null,
116+
panelId: dashboard.meta.focusPanelId,
117+
toggle: true,
112118
});
113119
}
114120
});

public/app/features/dashboard/viewStateSrv.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,12 @@ function (angular, _, $) {
8484

8585
DashboardViewState.prototype.update = function(state) {
8686
// implement toggle logic
87-
if (this.state.fullscreen && state.fullscreen) {
88-
if (this.state.edit === state.edit) {
89-
state.fullscreen = !state.fullscreen;
87+
if (state.toggle) {
88+
delete state.toggle;
89+
if (this.state.fullscreen && state.fullscreen) {
90+
if (this.state.edit === state.edit) {
91+
state.fullscreen = !state.fullscreen;
92+
}
9093
}
9194
}
9295

@@ -163,7 +166,7 @@ function (angular, _, $) {
163166
if (!render) { return false;}
164167

165168
$timeout(function() {
166-
if (self.oldTimeRange && self.oldTimeRange !== ctrl.range) {
169+
if (self.oldTimeRange !== ctrl.range) {
167170
self.$scope.broadcastRefresh();
168171
} else {
169172
self.$scope.$broadcast('render');

public/app/features/panel/panel_ctrl.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@ export class PanelCtrl {
111111
changeTab(newIndex) {
112112
this.editorTabIndex = newIndex;
113113
var route = this.$injector.get('$route');
114-
115114
route.current.params.tab = this.editorTabs[newIndex].title.toLowerCase();
116115
route.updateParams();
117116
}

public/sass/components/_row.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ a.dash-row-header-actions--tight {
247247

248248
.row-open {
249249
margin-top: 1px;
250-
left: -22px;
250+
left: -24px;
251251
position: absolute;
252252
z-index: 100;
253253
transition: .10s left;

tasks/options/watch.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ module.exports = function(config, grunt) {
3333

3434
// copy ts file also used by source maps
3535
//changes changed file source to that of the changed file
36-
var option = 'typescript.build.src';
37-
var result = filepath;
38-
grunt.config(option, result);
36+
grunt.config('typescript.build.src', filepath);
37+
grunt.config('tslint.source.files.src', filepath);
38+
3939
grunt.task.run('typescript:build');
4040
grunt.task.run('tslint');
4141
}

0 commit comments

Comments
 (0)