[bitbake-devel] [PATCH 07/12] bitbake: toastergui: libtoaster Throw an exception no url is specified

Ed Bartosh ed.bartosh at linux.intel.com
Tue Aug 4 19:46:35 UTC 2015


From: Michael Wood <michael.g.wood at intel.com>

At a minimum for this typeahead to work we need a url parameter to call
for a JSON reponse of items to filter on.

Signed-off-by: Michael Wood <michael.g.wood at intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh at linux.intel.com>
---
 lib/toaster/toastergui/static/js/libtoaster.js | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lib/toaster/toastergui/static/js/libtoaster.js b/lib/toaster/toastergui/static/js/libtoaster.js
index 51054c7..96e28b0 100644
--- a/lib/toaster/toastergui/static/js/libtoaster.js
+++ b/lib/toaster/toastergui/static/js/libtoaster.js
@@ -15,6 +15,8 @@ var libtoaster = (function (){
    *  arg of the item.
    */
   function _makeTypeahead (jQElement, xhrUrl, xhrParams, selectedCB) {
+    if (!xhrUrl || xhrUrl.length === 0)
+      throw("No url to typeahead supplied");
 
     jQElement.typeahead({
         source: function(query, process){
-- 
2.1.4




More information about the bitbake-devel mailing list