diff --git a/src/app/controllers/graphiteTarget.js b/src/app/controllers/graphiteTarget.js
index 8ec5bde50ac..6c0f4aca09d 100644
--- a/src/app/controllers/graphiteTarget.js
+++ b/src/app/controllers/graphiteTarget.js
@@ -168,11 +168,12 @@ function (angular, _, config, gfunc, Parser) {
segments.unshift({
type: 'template',
html: '[[' + filter.name + ']]',
- val: '[[' + filter.name + ']]'
+ val: '[[' + filter.name + ']]',
+ expandable: true,
});
});
- segments.unshift({val: '*', html: '' });
+ segments.unshift({val: '*', html: '', expandable: true });
$scope.altSegments = segments;
})
.then(null, function(err) {
@@ -193,6 +194,9 @@ function (angular, _, config, gfunc, Parser) {
$scope.targetChanged();
});
}
+ else {
+ $scope.segments = $scope.segments.splice(0, segmentIndex + 1);
+ }
setSegmentFocus(segmentIndex + 1);
$scope.targetChanged();