From f4ba80b7886b6c5538b700b5e64ece41da1b251d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Sun, 8 Dec 2013 17:18:27 +0100 Subject: [PATCH] worked on full screen edit mode --- src/app/controllers/dash.js | 10 +++++++++- src/app/directives/kibanaPanel.js | 2 +- src/app/panels/graphite/editor.html | 2 +- src/app/panels/graphite/module.html | 19 ++++++++++++++++++- src/app/panels/graphite/module.js | 20 +++++++++++++++++++- src/app/partials/dashboard.html | 9 +++++++++ src/index.html | 3 +-- 7 files changed, 58 insertions(+), 7 deletions(-) diff --git a/src/app/controllers/dash.js b/src/app/controllers/dash.js index d15330346d4..2db993bbd59 100644 --- a/src/app/controllers/dash.js +++ b/src/app/controllers/dash.js @@ -29,7 +29,7 @@ function (angular, config, _) { var module = angular.module('kibana.controllers'); module.controller('DashCtrl', function( - $scope, $route, ejsResource, fields, dashboard, alertSrv, panelMove, esVersion) { + $scope, $rootScope, $route, ejsResource, fields, dashboard, alertSrv, panelMove, esVersion) { $scope.requiredElasticSearchVersion = ">=0.20.5"; @@ -61,6 +61,14 @@ function (angular, config, _) { $scope.reset_row(); $scope.ejs = ejsResource(config.elasticsearch); + + $rootScope.$on('fullEditMode', function(evt, enabled) { + $scope.fullEditMode = enabled; + }); + }; + + $scope.closeFullEdit = function() { + $rootScope.$emit('fullEditMode', false); }; $scope.isPanel = function(obj) { diff --git a/src/app/directives/kibanaPanel.js b/src/app/directives/kibanaPanel.js index bbe5483d604..f437ba9a406 100644 --- a/src/app/directives/kibanaPanel.js +++ b/src/app/directives/kibanaPanel.js @@ -37,7 +37,7 @@ function (angular) { '' + '' + - ''+ + ''+ ''+ '' + diff --git a/src/app/panels/graphite/editor.html b/src/app/panels/graphite/editor.html index 94b820bff40..dc5b0a49d5e 100644 --- a/src/app/panels/graphite/editor.html +++ b/src/app/panels/graphite/editor.html @@ -6,7 +6,7 @@
- +
diff --git a/src/app/panels/graphite/module.html b/src/app/panels/graphite/module.html index 95bfe71670a..d56fe516d73 100644 --- a/src/app/panels/graphite/module.html +++ b/src/app/panels/graphite/module.html @@ -1,4 +1,4 @@ -
+
diff --git a/src/app/panels/graphite/module.js b/src/app/panels/graphite/module.js index c94a512c7f2..4fe946f860d 100644 --- a/src/app/panels/graphite/module.js +++ b/src/app/panels/graphite/module.js @@ -35,7 +35,7 @@ function (angular, app, $, _, kbn, moment, timeSeries, graphiteSrv) { var module = angular.module('kibana.panels.graphite', []); app.useModule(module); - module.controller('graphite', function($scope, querySrv, dashboard, filterSrv) { + module.controller('graphite', function($scope, $rootScope, querySrv, dashboard, filterSrv) { $scope.panelMeta = { modals : [ { @@ -383,6 +383,24 @@ function (angular, app, $, _, kbn, moment, timeSeries, graphiteSrv) { }); }; + $scope.openConfigureModal = function($event) { + $event.preventDefault(); + $event.stopPropagation(); + + var closeEditMode = $rootScope.$on('fullEditMode', function(evt, enabled) { + $scope.inEditMode = enabled; + if (!enabled) { + closeEditMode(); + } + + setTimeout(function() { + $scope.$emit('render'); + }, 200); + }); + + $rootScope.$emit('fullEditMode', true); + }; + // I really don't like this function, too much dom manip. Break out into directive? $scope.populate_modal = function(request) { $scope.inspector = angular.toJson(request,true); diff --git a/src/app/partials/dashboard.html b/src/app/partials/dashboard.html index b2ece2bfb50..b8cd431898f 100644 --- a/src/app/partials/dashboard.html +++ b/src/app/partials/dashboard.html @@ -13,6 +13,15 @@
+ +
+
+ Configure Panel + +
+
+ +
diff --git a/src/index.html b/src/index.html index f81fdc879ff..5c2fc8c658a 100644 --- a/src/index.html +++ b/src/index.html @@ -20,8 +20,7 @@ - - +