From 2f3a96f7a734ffbb1e416b3fe5b039b621f88a39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Fri, 15 Aug 2014 08:46:32 +0200 Subject: [PATCH] Removed add-panel tab from row editor, only add panels from the row menu now, do not want to ways to do the same thing --- src/app/controllers/grafanaCtrl.js | 2 +- src/app/directives/addPanel.js | 35 ------------------------------ src/app/directives/all.js | 3 +-- src/app/directives/grafanaPanel.js | 2 +- src/app/partials/dashboard.html | 15 ++++++++----- src/app/partials/roweditor.html | 15 +------------ src/index.html | 2 +- 7 files changed, 15 insertions(+), 59 deletions(-) delete mode 100644 src/app/directives/addPanel.js diff --git a/src/app/controllers/grafanaCtrl.js b/src/app/controllers/grafanaCtrl.js index e54dbfe8280..2b9f7de5fe2 100644 --- a/src/app/controllers/grafanaCtrl.js +++ b/src/app/controllers/grafanaCtrl.js @@ -80,7 +80,7 @@ function (angular, config, _, $) { var count = 0; console.log("registering digest counter"); - $scope.$watch(function() { + $scope.$watch(function digestCounter() { console.log(1); count++; }, function() { diff --git a/src/app/directives/addPanel.js b/src/app/directives/addPanel.js deleted file mode 100644 index e3f0fe7fc3d..00000000000 --- a/src/app/directives/addPanel.js +++ /dev/null @@ -1,35 +0,0 @@ -define([ - 'angular', - 'app', - 'lodash' -], -function (angular, app, _) { - 'use strict'; - - angular - .module('grafana.directives') - .directive('addPanel', function($compile) { - return { - restrict: 'A', - link: function($scope, elem) { - - $scope.$on("$destroy",function() { - elem.remove(); - }); - - $scope.$watch('panel.type', function() { - var _type = $scope.panel.type; - $scope.reset_panel(_type); - if(!_.isUndefined($scope.panel.type)) { - $scope.panel.loadingEditor = true; - $scope.require(['panels/'+$scope.panel.type.replace(".","/") +'/module'], function () { - var template = '
'; - elem.html($compile(angular.element(template))($scope)); - $scope.panel.loadingEditor = false; - }); - } - }); - } - }; - }); -}); \ No newline at end of file diff --git a/src/app/directives/all.js b/src/app/directives/all.js index ed97de93780..5236a1a619d 100644 --- a/src/app/directives/all.js +++ b/src/app/directives/all.js @@ -1,5 +1,4 @@ define([ - './addPanel', './arrayJoin', './dashUpload', './grafanaPanel', @@ -17,4 +16,4 @@ define([ './graphiteFuncEditor', './grafanaVersionCheck', './influxdbFuncEditor' -], function () {}); \ No newline at end of file +], function () {}); diff --git a/src/app/directives/grafanaPanel.js b/src/app/directives/grafanaPanel.js index b2d9c1d46a7..e0a16e55218 100644 --- a/src/app/directives/grafanaPanel.js +++ b/src/app/directives/grafanaPanel.js @@ -38,7 +38,7 @@ function (angular, $) { 'index:{{$index}},'+ 'onStart:\'panelMoveStart\','+ 'onStop:\'panelMoveStop\''+ - '}" ng-model="row.panels" ' + + '}" ng-model="panel" ' + '>' + '{{panel.title || "No title"}}' + '' + diff --git a/src/app/partials/dashboard.html b/src/app/partials/dashboard.html index 7a4d9fb92ca..c512252e1b8 100644 --- a/src/app/partials/dashboard.html +++ b/src/app/partials/dashboard.html @@ -98,11 +98,16 @@ -
- -
- -
+
+
diff --git a/src/app/partials/roweditor.html b/src/app/partials/roweditor.html index f47e2901ea6..ab66b08356a 100644 --- a/src/app/partials/roweditor.html +++ b/src/app/partials/roweditor.html @@ -2,7 +2,7 @@
Row settings
-
+
@@ -43,19 +43,6 @@
-
-

Select Panel Type

-
- - - Note: This row is full, new panels will wrap to a new line. You should add another row. - -
- -
-
-
-
-
+