From 1e7707b63f91eb310e3207da4d9cdd831a4851c5 Mon Sep 17 00:00:00 2001 From: Michael Wood Date: Tue, 4 Aug 2015 22:46:35 +0300 Subject: bitbake: toastergui: libtoaster Throw an exception no url is specified At a minimum for this typeahead to work we need a url parameter to call for a JSON reponse of items to filter on. (Bitbake rev: 80b214d93c5df63a251b807ca93f81f00c6bfeb2) Signed-off-by: Michael Wood Signed-off-by: Ed Bartosh Signed-off-by: Richard Purdie --- bitbake/lib/toaster/toastergui/static/js/libtoaster.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bitbake/lib/toaster/toastergui/static/js/libtoaster.js b/bitbake/lib/toaster/toastergui/static/js/libtoaster.js index c9ff6507ef..587f51fff9 100644 --- a/bitbake/lib/toaster/toastergui/static/js/libtoaster.js +++ b/bitbake/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){ -- cgit v1.2.3-54-g00ecf