Skip to content

Commit

Permalink
Merge pull request #36 from ikedam/feature/JENKINS-22316_autocomplete…
Browse files Browse the repository at this point in the history
…Dropdown

[JENKINS-22316] Show candidates containing the input value
  • Loading branch information
ikedam committed Feb 18, 2018
2 parents 3bc82bf + 1f7ec3a commit 584197e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Expand Up @@ -46,7 +46,7 @@ THE SOFTWARE.
</st:attribute>
</st:documentation>
<j:scope>
<j:set var="attrs" value="${attrs}" /> <!-- prepareDatabinding のために必要 -->
<j:set var="attrs" value="${attrs}" /> <!-- Required for prepareDatabinding -->
<j:set var="defValue" value="${attrs.value ?: instance[attrs.field]}" />
<f:prepareDatabinding/>

Expand Down
Expand Up @@ -51,11 +51,13 @@ Behaviour.register({"SELECT.staticCombobox": function(e) {

/*
* Changes from the original 3:
* Original behavior: Show candidates that matches the current incomplete input.
* Changed behavior : Show all the candidates, not concerning with the current incomplete input.
* Original behavior: Show candidates that start with the current incomplete input.
* Changed behavior : Show candidates that contain the current incomplete input.
*/
var c = new ComboBox(e,function(value) {
return items;
return items.filter(function (item) {
return item.indexOf(value) > -1;
});
}, {});

/*
Expand Down

0 comments on commit 584197e

Please sign in to comment.