summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster/toastergui/static/js/base.js
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/toaster/toastergui/static/js/base.js')
-rw-r--r--bitbake/lib/toaster/toastergui/static/js/base.js26
1 files changed, 17 insertions, 9 deletions
diff --git a/bitbake/lib/toaster/toastergui/static/js/base.js b/bitbake/lib/toaster/toastergui/static/js/base.js
index f25336110a..eba9c16783 100644
--- a/bitbake/lib/toaster/toastergui/static/js/base.js
+++ b/bitbake/lib/toaster/toastergui/static/js/base.js
@@ -89,8 +89,8 @@ function basePageInit(ctx) {
89 } 89 }
90 90
91 /* If we have a project setup the typeahead */ 91 /* If we have a project setup the typeahead */
92 if (selectedProject.projectTargetsUrl){ 92 if (selectedProject.recipesTypeAheadUrl){
93 libtoaster.makeTypeahead(newBuildTargetInput, selectedProject.projectTargetsUrl, { format: "json" }, function (item) { 93 libtoaster.makeTypeahead(newBuildTargetInput, selectedProject.recipesTypeAheadUrl, { format: "json" }, function (item) {
94 selectedTarget = item; 94 selectedTarget = item;
95 newBuildTargetBuildBtn.removeAttr("disabled"); 95 newBuildTargetBuildBtn.removeAttr("disabled");
96 }); 96 });
@@ -156,7 +156,7 @@ function basePageInit(ctx) {
156 $('#project .icon-pencil').hide(); 156 $('#project .icon-pencil').hide();
157 } 157 }
158 158
159 libtoaster.makeTypeahead(newBuildProjectInput, selectedProject.projectsUrl, { format : "json" }, function (item) { 159 libtoaster.makeTypeahead(newBuildProjectInput, selectedProject.projectsTypeAheadUrl, { format : "json" }, function (item) {
160 /* successfully selected a project */ 160 /* successfully selected a project */
161 newBuildProjectSaveBtn.removeAttr("disabled"); 161 newBuildProjectSaveBtn.removeAttr("disabled");
162 selectedProject = item; 162 selectedProject = item;
@@ -180,13 +180,21 @@ function basePageInit(ctx) {
180 180
181 newBuildTargetInput.removeAttr("disabled"); 181 newBuildTargetInput.removeAttr("disabled");
182 182
183 /* Update the typeahead to use the new selectedProject */ 183 /* We've got a new project so now we need to update the
184 libtoaster.makeTypeahead(newBuildTargetInput, selectedProject.projectTargetsUrl, { format: "json" }, function (item) { 184 * target urls. We can get this from the new project's info
185 /* successfully selected a target */ 185 */
186 selectedTarget = item; 186 $.getJSON(selectedProject.projectPageUrl, { format: "json" },
187 newBuildTargetBuildBtn.removeAttr("disabled"); 187 function(projectInfo){
188 }); 188 /* Update the typeahead to use the new selectedProject */
189 selectedProject = projectInfo;
190
191 libtoaster.makeTypeahead(newBuildTargetInput, selectedProject.recipesTypeAheadUrl, { format: "json" }, function (item) {
192 /* successfully selected a target */
193 selectedTarget = item;
194 newBuildTargetBuildBtn.removeAttr("disabled");
195 });
189 196
197 });
190 newBuildTargetInput.val(""); 198 newBuildTargetInput.val("");
191 199
192 /* set up new form aspect */ 200 /* set up new form aspect */