diff --git a/public/app/core/services/keybindingSrv.ts b/public/app/core/services/keybindingSrv.ts
index 073fa240bf8..787e93d0043 100644
--- a/public/app/core/services/keybindingSrv.ts
+++ b/public/app/core/services/keybindingSrv.ts
@@ -97,6 +97,22 @@ export class KeybindingSrv {
scope.appEvent('quick-snapshot');
});
+ this.bind('e', () => {
+ if (dashboard.meta.focusPanelId && dashboard.meta.canEdit) {
+ this.$rootScope.appEvent('panel-change-view', {
+ fullscreen: true, edit: true, panelId: dashboard.meta.focusPanelId
+ });
+ }
+ });
+
+ this.bind('d', () => {
+ if (dashboard.meta.focusPanelId && dashboard.meta.canEdit) {
+ var panelInfo = dashboard.getPanelInfoById(dashboard.meta.focusPanelId);
+ panelInfo.row.removePanel(panelInfo.panel);
+ dashboard.meta.focusPanelId = 0;
+ }
+ });
+
this.bind('esc', () => {
var popups = $('.popover.in');
if (popups.length > 0) {
diff --git a/public/app/features/dashboard/model.ts b/public/app/features/dashboard/model.ts
index 4f44746a867..99c2eef7660 100644
--- a/public/app/features/dashboard/model.ts
+++ b/public/app/features/dashboard/model.ts
@@ -185,10 +185,20 @@ export class DashboardModel {
}
toggleEditMode() {
+ if (!this.meta.canEdit) {
+ console.log('Not allowed to edit dashboard');
+ return;
+ }
+
this.editMode = !this.editMode;
this.updateSubmenuVisibility();
}
+ setPanelFocus(id) {
+ console.log('setting focus panel id', id);
+ this.meta.focusPanelId = id;
+ }
+
updateSubmenuVisibility() {
if (this.editMode) {
this.meta.submenuEnabled = true;
diff --git a/public/app/features/dashboard/row/row.html b/public/app/features/dashboard/row/row.html
index b311a3b07ba..6323c3288f6 100644
--- a/public/app/features/dashboard/row/row.html
+++ b/public/app/features/dashboard/row/row.html
@@ -41,6 +41,25 @@
+
+
diff --git a/public/app/plugins/panel/graph/graph.ts b/public/app/plugins/panel/graph/graph.ts
index 320a5aa0720..92e5ce177e1 100755
--- a/public/app/plugins/panel/graph/graph.ts
+++ b/public/app/plugins/panel/graph/graph.ts
@@ -59,7 +59,9 @@ module.directive('grafanaGraph', function($rootScope, timeSrv) {
}, scope);
rootScope.onAppEvent('clearCrosshair', function() {
- plot.clearCrosshair();
+ if (plot) {
+ plot.clearCrosshair();
+ }
}, scope);
// Receive render events
@@ -535,7 +537,7 @@ module.directive('grafanaGraph', function($rootScope, timeSrv) {
return "%H:%M";
}
- new GraphTooltip(elem, dashboard, scope, function() {
+ var tooltip = new GraphTooltip(elem, dashboard, scope, function() {
return sortedSeries;
});
@@ -547,6 +549,12 @@ module.directive('grafanaGraph', function($rootScope, timeSrv) {
});
});
});
+
+ scope.$on('$destroy', function() {
+ tooltip.destroy();
+ elem.off();
+ elem.remove();
+ });
}
};
});
diff --git a/public/app/plugins/panel/graph/graph_tooltip.js b/public/app/plugins/panel/graph/graph_tooltip.js
index 5ae03ccf813..704eb9097ec 100644
--- a/public/app/plugins/panel/graph/graph_tooltip.js
+++ b/public/app/plugins/panel/graph/graph_tooltip.js
@@ -12,6 +12,10 @@ function ($, _) {
var $tooltip = $('
');
+ this.destroy = function() {
+ $tooltip.remove();
+ };
+
this.findHoverIndexFromDataPoints = function(posX, series, last) {
var ps = series.datapoints.pointsize;
var initial = last*ps;
diff --git a/public/sass/components/_row.scss b/public/sass/components/_row.scss
index 9c4af6cdb97..30d648bbefc 100644
--- a/public/sass/components/_row.scss
+++ b/public/sass/components/_row.scss
@@ -215,3 +215,45 @@ a.dash-row-header-actions--tight {
width: 2rem;
}
+
+// Legacy mode
+.row-tab {
+ .dropdown-menu-right {
+ top: 0;
+ left: 33px;
+ }
+}
+
+.row-tab-button {
+ padding: 0px;
+ cursor: pointer;
+ vertical-align: middle;
+ width: 30px;
+ height: 30px;
+ text-align: center;
+ display: inline-block;
+ line-height: 30px;
+ background: $btn-success-bg;
+ color: rgba(255,255,255,.90);
+}
+
+.row-button {
+ width: 24px;
+ float: left;
+ cursor: pointer;
+ line-height: 31px;
+ background-color: $blue-dark;
+}
+
+.row-open {
+ margin-top: 1px;
+ left: -22px;
+ position: absolute;
+ z-index: 100;
+ transition: .10s left;
+ transition-delay: .05s;
+
+ &:hover {
+ left: 0px;
+ }
+}
diff --git a/public/sass/pages/_dashboard.scss b/public/sass/pages/_dashboard.scss
index d02a3101ce6..024567e0c39 100644
--- a/public/sass/pages/_dashboard.scss
+++ b/public/sass/pages/_dashboard.scss
@@ -152,7 +152,11 @@ div.flot-text {
}
.panel-highlight {
- box-shadow: inset 0 1px 1px rgba(0,0,0,.075),0 0 5px rgba(82,168,236,10.8)
+ box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 5px rgba(82,168,236,10.8)
+}
+
+.panel-hover-highlight {
+ box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 1px rgba(82,168,236,10.8)
}
.on-drag-hover {
diff --git a/public/test/test-main.js b/public/test/test-main.js
index 0774b004eab..4e77a7eae54 100644
--- a/public/test/test-main.js
+++ b/public/test/test-main.js
@@ -10,6 +10,7 @@
baseURL: '/base/',
defaultJSExtensions: true,
paths: {
+ 'mousetrap': 'vendor/npm/mousetrap/mousetrap.js',
'eventemitter3': 'vendor/npm/eventemitter3/index.js',
'tether': 'vendor/npm/tether/dist/js/tether.js',
'tether-drop': 'vendor/npm/tether-drop/dist/js/drop.js',
@@ -65,6 +66,10 @@
format: 'cjs',
exports: 'EventEmitter'
},
+ 'vendor/npm/mousetrap/mousetrap.js': {
+ format: 'global',
+ exports: 'Mousetrap'
+ },
}
});