Update the hint appropriately

This commit is contained in:
seif 2014-08-18 13:44:22 +02:00 committed by Mike Tutkowski
parent a0f1012903
commit f2781a5ce3
2 changed files with 39 additions and 2 deletions

View File

@ -466,11 +466,32 @@
}
} else if (field.isTokenInput) { // jquery.tokeninput.js
isAsync = true;
var hint= "Type in a search term";
var noResults= "No results";
if (field.label === 'label.storage.tags')
{
hint = "Type in part of a storage tag";
noResults = "No storage tags found";
}
else if (field.label === 'label.host.tags')
{
hint = "Type in part of a host tag";
noResults = "No host tags found";
}
selectArgs = {
context: args.context,
response: {
success: function(args) {
$input.tokenInput(unique_tags(args.data), { theme: "facebook", preventDuplicates: true });
$input.tokenInput(unique_tags(args.data),
{
theme: "facebook",
preventDuplicates: true,
hintText: hint,
noResultsText: noResults
});
}
}
};

View File

@ -734,6 +734,20 @@
isAsync = true;
var hint = "Type in a search term";
var noResults = "No results";
if ($value.data('value_token').label === 'label.storage.tags')
{
hint = "Type in part of a storage tag";
noResults= "No storage tags found";
}
else if ($value.data('value_token').label === 'label.host.tags')
{
hint = "Type in part of a host tag";
noResults = "No host tags found";
}
selectArgs = {
context: $detailView.data('view-args').context,
response: {
@ -743,7 +757,9 @@
theme: "facebook",
preventDuplicates: true,
prePopulate: existing_tags,
processPrePopulate: true
processPrePopulate: true,
hintText: hint,
noResultsText: noResults
});
}
}