diff --git a/public/app/core/directives/rebuild_on_change.ts b/public/app/core/directives/rebuild_on_change.ts index 3a9399c61ed..6cc7ad899c1 100644 --- a/public/app/core/directives/rebuild_on_change.ts +++ b/public/app/core/directives/rebuild_on_change.ts @@ -28,12 +28,12 @@ function rebuildOnChange($compile) { return { transclude: true, priority: 600, - restrict: 'A', + restrict: 'E', link: function(scope, elem, attrs, ctrl, transclude) { var childScope, previousElements; var uncompiledHtml; - scope.$watch(attrs.rebuildOnChange, function rebuildOnChangeAction(value) { + scope.$watch(attrs.property, function rebuildOnChangeAction(value) { if (childScope) { childScope.$destroy(); @@ -41,7 +41,7 @@ function rebuildOnChange($compile) { elem.empty(); } - if (value) { + if (value || attrs.ignoreNull) { if (!childScope) { transclude(function(clone, newScope) { childScope = newScope; diff --git a/public/app/features/datasources/partials/edit.html b/public/app/features/datasources/partials/edit.html index 520515907d5..ad3473f0ea7 100644 --- a/public/app/features/datasources/partials/edit.html +++ b/public/app/features/datasources/partials/edit.html @@ -41,10 +41,10 @@
-
+ -
+
Testing....
diff --git a/public/app/partials/metrics.html b/public/app/partials/metrics.html index 8ab5c4a1677..934feb1eb2c 100644 --- a/public/app/partials/metrics.html +++ b/public/app/partials/metrics.html @@ -1,8 +1,10 @@
- - + + + +
diff --git a/public/app/plugins/datasource/graphite/add_graphite_func.js b/public/app/plugins/datasource/graphite/add_graphite_func.js index 46d93f6481f..6c218513d57 100644 --- a/public/app/plugins/datasource/graphite/add_graphite_func.js +++ b/public/app/plugins/datasource/graphite/add_graphite_func.js @@ -22,6 +22,7 @@ function (angular, _, $, gfunc) { link: function($scope, elem) { var categories = gfunc.getCategories(); var allFunctions = getAllFunctionNames(categories); + var ctrl = $scope.ctrl; $scope.functionMenu = createFunctionDropDownMenu(categories); @@ -48,7 +49,7 @@ function (angular, _, $, gfunc) { } $scope.$apply(function() { - $scope.addFunction(funcDef); + ctrl.addFunction(funcDef); }); $input.trigger('blur'); diff --git a/public/app/plugins/datasource/graphite/func_editor.js b/public/app/plugins/datasource/graphite/func_editor.js index 63ee4b3f7cf..cd1f747bc4d 100644 --- a/public/app/plugins/datasource/graphite/func_editor.js +++ b/public/app/plugins/datasource/graphite/func_editor.js @@ -27,6 +27,7 @@ function (angular, _, $) { link: function postLink($scope, elem) { var $funcLink = $(funcSpanTemplate); var $funcControls = $(funcControlsTemplate); + var ctrl = $scope.ctrl; var func = $scope.func; var funcDef = func.def; var scheduledRelink = false; @@ -79,11 +80,13 @@ function (angular, _, $) { func.updateParam($input.val(), paramIndex); scheduledRelinkIfNeeded(); - $scope.$apply($scope.targetChanged); - } + $scope.$apply(function() { + ctrl.targetChanged(); + }); - $input.hide(); - $link.show(); + $input.hide(); + $link.show(); + } } function inputKeyPress(paramIndex, e) { @@ -198,7 +201,7 @@ function (angular, _, $) { if ($target.hasClass('fa-remove')) { toggleFuncControls(); $scope.$apply(function() { - $scope.removeFunction($scope.func); + ctrl.removeFunction($scope.func); }); return; } @@ -206,7 +209,7 @@ function (angular, _, $) { if ($target.hasClass('fa-arrow-left')) { $scope.$apply(function() { _.move($scope.functions, $scope.$index, $scope.$index - 1); - $scope.targetChanged(); + ctrl.targetChanged(); }); return; } @@ -214,7 +217,7 @@ function (angular, _, $) { if ($target.hasClass('fa-arrow-right')) { $scope.$apply(function() { _.move($scope.functions, $scope.$index, $scope.$index + 1); - $scope.targetChanged(); + ctrl.targetChanged(); }); return; } diff --git a/public/app/plugins/datasource/graphite/query_ctrl.ts b/public/app/plugins/datasource/graphite/query_ctrl.ts index 8d1922c4802..f6afe8a6d13 100644 --- a/public/app/plugins/datasource/graphite/query_ctrl.ts +++ b/public/app/plugins/datasource/graphite/query_ctrl.ts @@ -1,6 +1,7 @@ /// import './add_graphite_func'; +import './func_editor'; import angular from 'angular'; import _ from 'lodash'; diff --git a/public/app/plugins/datasource/prometheus/partials/query.editor.html b/public/app/plugins/datasource/prometheus/partials/query.editor.html index 5a5a468ece7..cb51f28ff0e 100644 --- a/public/app/plugins/datasource/prometheus/partials/query.editor.html +++ b/public/app/plugins/datasource/prometheus/partials/query.editor.html @@ -9,14 +9,14 @@
  • - +