Make using a hint (or no results) text more flexible

This commit is contained in:
seif 2014-08-18 15:04:49 -06:00 committed by Mike Tutkowski
parent f2781a5ce3
commit c319c0b3e0
4 changed files with 22 additions and 42 deletions

View File

@ -21,8 +21,8 @@ var DEFAULT_SETTINGS = {
jsonContainer: null, jsonContainer: null,
// Display settings // Display settings
hintText: "Type in part of a storage tag", hintText: "Type in a search term",
noResultsText: "No storage tags found", noResultsText: "No results",
searchingText: "Searching...", searchingText: "Searching...",
deleteText: "×", deleteText: "×",
animateDropdown: true, animateDropdown: true,

View File

@ -15197,7 +15197,9 @@
} }
args.response.success({ args.response.success({
data: tags data: tags,
hintText: "Type in part of a host tag",
noResultsText: "No host tags found"
}); });
}, },
error: function(XMLHttpResponse) { error: function(XMLHttpResponse) {
@ -15790,7 +15792,9 @@
} }
args.response.success({ args.response.success({
data: tags data: tags,
hintText: "Type in part of a host tag",
noResultsText: "No host tags found"
}); });
}, },
error: function(XMLHttpResponse) { error: function(XMLHttpResponse) {
@ -16970,7 +16974,9 @@
} }
args.response.success({ args.response.success({
data: tags data: tags,
hintText: "Type in part of a storage tag",
noResultsText: "No storage tags found"
}); });
}, },
error: function(XMLHttpResponse) { error: function(XMLHttpResponse) {
@ -17329,7 +17335,9 @@
} }
args.response.success({ args.response.success({
data: tags data: tags,
hintText: "Type in part of a storage tag",
noResultsText: "No storage tags found"
}); });
}, },
error: function(XMLHttpResponse) { error: function(XMLHttpResponse) {

View File

@ -467,20 +467,6 @@
} else if (field.isTokenInput) { // jquery.tokeninput.js } else if (field.isTokenInput) { // jquery.tokeninput.js
isAsync = true; 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 = { selectArgs = {
context: args.context, context: args.context,
response: { response: {
@ -489,8 +475,8 @@
{ {
theme: "facebook", theme: "facebook",
preventDuplicates: true, preventDuplicates: true,
hintText: hint, hintText: args.hintText,
noResultsText: noResults noResultsText: args.noResultsText
}); });
} }
} }

View File

@ -672,7 +672,7 @@
// Turn into form field // Turn into form field
var selectData = $value.data('detail-view-editable-select'); var selectData = $value.data('detail-view-editable-select');
var isBoolean = $value.data('detail-view-editable-boolean'); var isBoolean = $value.data('detail-view-editable-boolean');
var isTokenInput = $value.data('detail-view-is-TokenInput'); var isTokenInput = $value.data('detail-view-is-token-input');
var data = !isBoolean ? cloudStack.sanitizeReverse($value.html()) : $value.data('detail-view-boolean-value'); var data = !isBoolean ? cloudStack.sanitizeReverse($value.html()) : $value.data('detail-view-boolean-value');
var rules = $value.data('validation-rules') ? $value.data('validation-rules') : {}; var rules = $value.data('validation-rules') ? $value.data('validation-rules') : {};
var isPassword = $value.data('detail-view-is-password'); var isPassword = $value.data('detail-view-is-password');
@ -734,20 +734,6 @@
isAsync = true; 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 = { selectArgs = {
context: $detailView.data('view-args').context, context: $detailView.data('view-args').context,
response: { response: {
@ -758,8 +744,8 @@
preventDuplicates: true, preventDuplicates: true,
prePopulate: existing_tags, prePopulate: existing_tags,
processPrePopulate: true, processPrePopulate: true,
hintText: hint, hintText: args.hintText,
noResultsText: noResults noResultsText: args.noResultsText
}); });
} }
} }
@ -773,7 +759,7 @@
$value.append($input); $value.append($input);
token_value = data; token_value = data;
$value.data('value_token').dataProvider(selectArgs); $value.data('value-token').dataProvider(selectArgs);
} else { } else {
// Text input // Text input
$value.append( $value.append(
@ -1129,8 +1115,8 @@
if (value.isTokenInput) if (value.isTokenInput)
{ {
$value.data('detail-view-is-TokenInput', true); $value.data('detail-view-is-token-input', true);
$value.data('value_token', value); $value.data('value-token', value);
} }
} }