Skip to content

Commit

Permalink
pass the current value of the entry text box into the completion func…
Browse files Browse the repository at this point in the history
…tion
  • Loading branch information
jstrachan committed Jul 10, 2013
1 parent e5cb818 commit 5d58cb7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Expand Up @@ -14,7 +14,7 @@

<div class="controls">
<input id="endpointPath" class="span10" type="text" ng-model="endpointPath" placeholder="name"
typeahead="title for title in endpointCompletions() | filter:$viewValue" typeahead-editable='true'
typeahead="title for title in endpointCompletions($viewValue) | filter:$viewValue" typeahead-editable='true'
min-length="1">
</div>
</div>
Expand Down
6 changes: 3 additions & 3 deletions hawtio-web/src/main/webapp/app/camel/js/endpointChooser.ts
Expand Up @@ -221,14 +221,14 @@ module Camel {
}
});

$scope.endpointCompletions = () => {
$scope.endpointCompletions = (completionText) => {
var answer = [];
var mbean = findCamelContextMBean();
var componentName = $scope.selectedComponentName;
var endpointParameters = {};
console.log("component " + $scope.selectedComponentName + " endpointPath " + $scope.endpointPath);
console.log("component " + $scope.selectedComponentName + " endpointPath " + $scope.endpointPath + " completion text: " + completionText);
// TODO bit of a hack here - for scope issues sometimes the endpointPath is defined in a child scope!
var completionText = $scope.endpointPath || $scope.$$childHead.endpointPath || "";
//var completionText = $scope.endpointPath || $scope.$$childHead.endpointPath || "";
if (mbean && componentName && completionText) {
answer = $scope.jolokia.execute(mbean, 'completeEndpointPath', componentName, endpointParameters, completionText, onSuccess(null, silentOptions));
}
Expand Down
2 changes: 1 addition & 1 deletion hawtio-web/src/main/webapp/app/wiki/html/camelCanvas.html
Expand Up @@ -146,7 +146,7 @@

<div class="controls">
<input id="endpointPath" class="span10" type="text" ng-model="endpointPath" placeholder="name"
typeahead="title for title in endpointCompletions() | filter:$viewValue"
typeahead="title for title in endpointCompletions($viewValue) | filter:$viewValue"
typeahead-editable='true'
min-length="1">
</div>
Expand Down

0 comments on commit 5d58cb7

Please sign in to comment.