working on graphite target editor

This commit is contained in:
Torkel Ödegaard
2013-12-20 08:37:48 +01:00
parent 8e69f82553
commit 816cc98658
3 changed files with 13 additions and 6 deletions
+9 -3
View File
@@ -14,15 +14,21 @@ function (angular, _) {
var strSegments = $scope.target.target.split('.');
_.each(strSegments, function (segment, index) {
if (segment === '*') {
segment = '<i class="icon-asterisk"><i>';
$scope.segments[index] = { val: segment, html: '<i class="icon-asterisk"><i>' };
return;
}
$scope.segments[index] = { val: segment };
$scope.segments[index] = { val: segment, html: segment};
});
};
$scope.setSegmentStar = function (index) {
$scope.segments[index] = {val: '<i class="icon-asterisk"><i>' };
$scope.segments[index].val = '*';
$scope.segments[index].html = '<i class="icon-asterisk"><i>';
$scope.target.target = _.reduce($scope.segments, function(result, segment) {
return result ? (result + "." + segment.val) : segment.val;
}, null);
$scope.targetChanged();
};
$scope.targetChanged = function() {