mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Fixes #191, update graph after adding new function and not changing default value
This commit is contained in:
parent
b396563235
commit
9ebf769b4d
@ -4,7 +4,7 @@
|
||||
"company": "Coding Instinct AB"
|
||||
},
|
||||
"name": "grafana",
|
||||
"version": "1.5.0",
|
||||
"version": "1.5.1",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "http://github.com/torkelo/grafana.git"
|
||||
|
@ -211,10 +211,14 @@ function (angular, _, config, gfunc, Parser) {
|
||||
return;
|
||||
}
|
||||
|
||||
var oldTarget = $scope.target.target;
|
||||
|
||||
var target = getSegmentPathUpTo($scope.segments.length);
|
||||
target = _.reduce($scope.functions, wrapFunction, target);
|
||||
$scope.target.target = target;
|
||||
$scope.$parent.get_data();
|
||||
$scope.target.target = _.reduce($scope.functions, wrapFunction, target);
|
||||
|
||||
if ($scope.target.target !== oldTarget) {
|
||||
$scope.$parent.get_data();
|
||||
}
|
||||
};
|
||||
|
||||
$scope.removeFunction = function(func) {
|
||||
|
@ -60,11 +60,8 @@ function (angular, _, $) {
|
||||
if ($input.val() !== '') {
|
||||
$link.text($input.val());
|
||||
|
||||
if (func.updateParam($input.val(), paramIndex)) {
|
||||
$scope.$apply(function() {
|
||||
$scope.targetChanged();
|
||||
});
|
||||
}
|
||||
func.updateParam($input.val(), paramIndex);
|
||||
$scope.$apply($scope.targetChanged);
|
||||
}
|
||||
|
||||
$input.hide();
|
||||
|
@ -314,8 +314,6 @@ function (_) {
|
||||
};
|
||||
|
||||
FuncInstance.prototype.updateParam = function(strValue, index) {
|
||||
var oldValue = this.params[index];
|
||||
|
||||
if (this.def.params[index].type === 'int') {
|
||||
this.params[index] = parseInt(strValue, 10);
|
||||
}
|
||||
@ -324,8 +322,6 @@ function (_) {
|
||||
}
|
||||
|
||||
this.updateText();
|
||||
|
||||
return oldValue !== this.params[index];
|
||||
};
|
||||
|
||||
FuncInstance.prototype.updateText = function () {
|
||||
|
Loading…
Reference in New Issue
Block a user