From f2781a5ce3af01fbb92fe666d2954382ccaa5997 Mon Sep 17 00:00:00 2001 From: seif Date: Mon, 18 Aug 2014 13:44:22 +0200 Subject: [PATCH] Update the hint appropriately --- ui/scripts/ui/dialog.js | 23 ++++++++++++++++++++++- ui/scripts/ui/widgets/detailView.js | 18 +++++++++++++++++- 2 files changed, 39 insertions(+), 2 deletions(-) diff --git a/ui/scripts/ui/dialog.js b/ui/scripts/ui/dialog.js index 87866d56625..41cbef09ad1 100644 --- a/ui/scripts/ui/dialog.js +++ b/ui/scripts/ui/dialog.js @@ -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 + }); } } }; diff --git a/ui/scripts/ui/widgets/detailView.js b/ui/scripts/ui/widgets/detailView.js index 92f1e2cf9cd..2d619771eb8 100644 --- a/ui/scripts/ui/widgets/detailView.js +++ b/ui/scripts/ui/widgets/detailView.js @@ -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 }); } }