From cdea420285b184d9e444e3b85a0bc25bf785c24d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Wed, 2 Nov 2016 21:45:46 +0100 Subject: [PATCH] ux(dashboard): fixes for changing panel tabs, #6442 --- public/app/core/services/keybindingSrv.ts | 10 ++++++++-- public/app/features/dashboard/viewStateSrv.js | 11 +++++++---- public/app/features/panel/panel_ctrl.ts | 1 - public/sass/components/_row.scss | 2 +- tasks/options/watch.js | 6 +++--- 5 files changed, 19 insertions(+), 11 deletions(-) diff --git a/public/app/core/services/keybindingSrv.ts b/public/app/core/services/keybindingSrv.ts index cd188719c58..3f54722424d 100644 --- a/public/app/core/services/keybindingSrv.ts +++ b/public/app/core/services/keybindingSrv.ts @@ -100,7 +100,10 @@ export class KeybindingSrv { this.bind('e', () => { if (dashboard.meta.focusPanelId && dashboard.meta.canEdit) { 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', () => { if (dashboard.meta.focusPanelId) { this.$rootScope.appEvent('panel-change-view', { - fullscreen: true, edit: null, panelId: dashboard.meta.focusPanelId + fullscreen: true, + edit: null, + panelId: dashboard.meta.focusPanelId, + toggle: true, }); } }); diff --git a/public/app/features/dashboard/viewStateSrv.js b/public/app/features/dashboard/viewStateSrv.js index 466b7389007..993e8cfd09f 100644 --- a/public/app/features/dashboard/viewStateSrv.js +++ b/public/app/features/dashboard/viewStateSrv.js @@ -84,9 +84,12 @@ function (angular, _, $) { DashboardViewState.prototype.update = function(state) { // implement toggle logic - if (this.state.fullscreen && state.fullscreen) { - if (this.state.edit === state.edit) { - state.fullscreen = !state.fullscreen; + if (state.toggle) { + delete state.toggle; + if (this.state.fullscreen && state.fullscreen) { + if (this.state.edit === state.edit) { + state.fullscreen = !state.fullscreen; + } } } @@ -163,7 +166,7 @@ function (angular, _, $) { if (!render) { return false;} $timeout(function() { - if (self.oldTimeRange && self.oldTimeRange !== ctrl.range) { + if (self.oldTimeRange !== ctrl.range) { self.$scope.broadcastRefresh(); } else { self.$scope.$broadcast('render'); diff --git a/public/app/features/panel/panel_ctrl.ts b/public/app/features/panel/panel_ctrl.ts index a80ffb669dc..2cff5993543 100644 --- a/public/app/features/panel/panel_ctrl.ts +++ b/public/app/features/panel/panel_ctrl.ts @@ -111,7 +111,6 @@ export class PanelCtrl { changeTab(newIndex) { this.editorTabIndex = newIndex; var route = this.$injector.get('$route'); - route.current.params.tab = this.editorTabs[newIndex].title.toLowerCase(); route.updateParams(); } diff --git a/public/sass/components/_row.scss b/public/sass/components/_row.scss index 30d648bbefc..8646f9412d9 100644 --- a/public/sass/components/_row.scss +++ b/public/sass/components/_row.scss @@ -247,7 +247,7 @@ a.dash-row-header-actions--tight { .row-open { margin-top: 1px; - left: -22px; + left: -24px; position: absolute; z-index: 100; transition: .10s left; diff --git a/tasks/options/watch.js b/tasks/options/watch.js index 3d4ed5ac02c..a7da4d325c2 100644 --- a/tasks/options/watch.js +++ b/tasks/options/watch.js @@ -33,9 +33,9 @@ module.exports = function(config, grunt) { // copy ts file also used by source maps //changes changed file source to that of the changed file - var option = 'typescript.build.src'; - var result = filepath; - grunt.config(option, result); + grunt.config('typescript.build.src', filepath); + grunt.config('tslint.source.files.src', filepath); + grunt.task.run('typescript:build'); grunt.task.run('tslint'); }