diff options
Diffstat (limited to 'bitbake/lib/toaster/toastergui/static/js/libtoaster.js')
-rw-r--r-- | bitbake/lib/toaster/toastergui/static/js/libtoaster.js | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/bitbake/lib/toaster/toastergui/static/js/libtoaster.js b/bitbake/lib/toaster/toastergui/static/js/libtoaster.js index 99e1f03095..72fb0a93f5 100644 --- a/bitbake/lib/toaster/toastergui/static/js/libtoaster.js +++ b/bitbake/lib/toaster/toastergui/static/js/libtoaster.js | |||
@@ -10,16 +10,16 @@ var libtoaster = (function (){ | |||
10 | * xhrUrl: the url to get the JSON from expects JSON in the form: | 10 | * xhrUrl: the url to get the JSON from expects JSON in the form: |
11 | * { "list": [ { "name": "test", "detail" : "a test thing" }, .... ] } | 11 | * { "list": [ { "name": "test", "detail" : "a test thing" }, .... ] } |
12 | * xhrParams: the data/parameters to pass to the getJSON url e.g. | 12 | * xhrParams: the data/parameters to pass to the getJSON url e.g. |
13 | * { 'type' : 'projects' } the text typed will be passed as 'value'. | 13 | * { 'type' : 'projects' } the text typed will be passed as 'search'. |
14 | * selectedCB: function to call once an item has been selected one | 14 | * selectedCB: function to call once an item has been selected one |
15 | * arg of the item. | 15 | * arg of the item. |
16 | */ | 16 | */ |
17 | function _makeTypeahead (jQElement, xhrParams, selectedCB) { | 17 | function _makeTypeahead (jQElement, xhrUrl, xhrParams, selectedCB) { |
18 | 18 | ||
19 | jQElement.typeahead({ | 19 | jQElement.typeahead({ |
20 | source: function(query, process){ | 20 | source: function(query, process){ |
21 | xhrParams.value = query; | 21 | xhrParams.search = query; |
22 | $.getJSON(libtoaster.ctx.xhrDataTypeaheadUrl, this.options.xhrParams, function(data){ | 22 | $.getJSON(xhrUrl, this.options.xhrParams, function(data){ |
23 | if (data.error !== "ok") { | 23 | if (data.error !== "ok") { |
24 | console.log("Error getting data from server "+data.error); | 24 | console.log("Error getting data from server "+data.error); |
25 | return; | 25 | return; |
@@ -41,7 +41,7 @@ var libtoaster = (function (){ | |||
41 | return $('<span></span>').text(item.name).get(0); | 41 | return $('<span></span>').text(item.name).get(0); |
42 | }, | 42 | }, |
43 | sorter: function (items) { return items; }, | 43 | sorter: function (items) { return items; }, |
44 | xhrUrl: libtoaster.ctx.xhrDataTypeaheadUrl, | 44 | xhrUrl: xhrUrl, |
45 | xhrParams: xhrParams, | 45 | xhrParams: xhrParams, |
46 | }); | 46 | }); |
47 | 47 | ||
@@ -172,7 +172,7 @@ var libtoaster = (function (){ | |||
172 | 172 | ||
173 | function _getLayerDepsForProject(projectId, layerId, onSuccess, onFail){ | 173 | function _getLayerDepsForProject(projectId, layerId, onSuccess, onFail){ |
174 | /* Check for dependencies not in the current project */ | 174 | /* Check for dependencies not in the current project */ |
175 | $.getJSON(libtoaster.ctx.xhrDataTypeaheadUrl, | 175 | $.getJSON(libtoaster.ctx.xhrProjectDataTypeaheadUrl, |
176 | { type: 'layerdeps', 'value': layerId , project_id: projectId }, | 176 | { type: 'layerdeps', 'value': layerId , project_id: projectId }, |
177 | function(data) { | 177 | function(data) { |
178 | if (data.error != "ok") { | 178 | if (data.error != "ok") { |