diff --git a/public/app/features/annotations/editor_ctrl.ts b/public/app/features/annotations/editor_ctrl.ts
index 3929d7d9a32..cb76045dbec 100644
--- a/public/app/features/annotations/editor_ctrl.ts
+++ b/public/app/features/annotations/editor_ctrl.ts
@@ -67,8 +67,8 @@ export class AnnotationsEditorCtrl {
this.annotations.push(this.currentAnnotation);
this.reset();
this.mode = 'list';
- this.$scope.updateSubmenuVisibility();
this.$scope.broadcastRefresh();
+ this.$scope.dashboard.updateSubmenuVisibility();
};
removeAnnotation(annotation) {
diff --git a/public/app/features/dashboard/dashboard_ctrl.ts b/public/app/features/dashboard/dashboard_ctrl.ts
index ef6258d86d3..1dfe54c6636 100644
--- a/public/app/features/dashboard/dashboard_ctrl.ts
+++ b/public/app/features/dashboard/dashboard_ctrl.ts
@@ -64,7 +64,7 @@ export class DashboardCtrl {
dashboardKeybindings.shortcuts($scope);
- $scope.updateSubmenuVisibility();
+ $scope.dashboard.updateSubmenuVisibility();
$scope.setWindowTitleAndTheme();
$scope.appEvent("dashboard-initialized", $scope.dashboard);
@@ -94,10 +94,6 @@ export class DashboardCtrl {
dynamicDashboardSrv.process();
};
- $scope.updateSubmenuVisibility = function() {
- $scope.submenuEnabled = $scope.dashboard.isSubmenuFeaturesEnabled();
- };
-
$scope.setWindowTitleAndTheme = function() {
window.document.title = config.window_title_prefix + $scope.dashboard.title;
};
diff --git a/public/app/features/dashboard/dashnav/dashnav.html b/public/app/features/dashboard/dashnav/dashnav.html
index 7bd9295de25..47d12d05206 100644
--- a/public/app/features/dashboard/dashnav/dashnav.html
+++ b/public/app/features/dashboard/dashnav/dashnav.html
@@ -52,6 +52,7 @@
-
-
- Leave Build Mode
-
diff --git a/public/app/features/dashboard/keybindings.js b/public/app/features/dashboard/keybindings.js
index c3fc69c7a32..864538e19c1 100644
--- a/public/app/features/dashboard/keybindings.js
+++ b/public/app/features/dashboard/keybindings.js
@@ -44,7 +44,7 @@ function(angular, $) {
}, { inputDisabled: true });
keyboardManager.bind('ctrl+b', function() {
- scope.dashboard.editMode = !scope.dashboard.editMode;
+ scope.dashboard.toggleEditMode();
}, { inputDisabled: true });
keyboardManager.bind('ctrl+s', function(evt) {
diff --git a/public/app/features/dashboard/model.ts b/public/app/features/dashboard/model.ts
index 3149d76b4df..12abddc16ef 100644
--- a/public/app/features/dashboard/model.ts
+++ b/public/app/features/dashboard/model.ts
@@ -34,6 +34,7 @@ export class DashboardModel {
gnetId: any;
meta: any;
events: any;
+ editMode: boolean;
constructor(data, meta) {
if (!data) {
@@ -171,12 +172,22 @@ export class DashboardModel {
row.panels.push(panel);
}
- isSubmenuFeaturesEnabled() {
+ toggleEditMode() {
+ this.editMode = !this.editMode;
+ this.updateSubmenuVisibility();
+ }
+
+ updateSubmenuVisibility() {
+ if (this.editMode) {
+ this.meta.submenuEnabled = true;
+ return;
+ }
+
var visableTemplates = _.filter(this.templating.list, function(template) {
return template.hideVariable === undefined || template.hideVariable === false;
});
- return visableTemplates.length > 0 || this.annotations.list.length > 0 || this.links.length > 0;
+ this.meta.submenuEnabled = visableTemplates.length > 0 || this.annotations.list.length > 0 || this.links.length > 0;
}
getPanelInfoById(panelId) {
diff --git a/public/app/features/dashboard/row/options.html b/public/app/features/dashboard/row/options.html
new file mode 100644
index 00000000000..19d3b92aeed
--- /dev/null
+++ b/public/app/features/dashboard/row/options.html
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
+
+
Row Templating
+
+
+
diff --git a/public/app/features/dashboard/row/options.ts b/public/app/features/dashboard/row/options.ts
new file mode 100644
index 00000000000..894596c1bca
--- /dev/null
+++ b/public/app/features/dashboard/row/options.ts
@@ -0,0 +1,24 @@
+///
+
+import _ from 'lodash';
+
+import {coreModule} from 'app/core/core';
+
+export class RowOptionsCtrl {
+}
+
+export function rowOptionsDirective() {
+ return {
+ restrict: 'E',
+ templateUrl: 'public/app/features/dashboard/row/options.html',
+ controller: RowOptionsCtrl,
+ bindToController: true,
+ controllerAs: 'ctrl',
+ scope: {
+ row: "=",
+ onClose: "&"
+ },
+ };
+}
+
+coreModule.directive('dashRowOptions', rowOptionsDirective);
diff --git a/public/app/features/dashboard/row/row.html b/public/app/features/dashboard/row/row.html
index a1b1e1a1ea9..b01db354957 100644
--- a/public/app/features/dashboard/row/row.html
+++ b/public/app/features/dashboard/row/row.html
@@ -1,95 +1,75 @@
-
-
-
-
-
-
+