diff options
| author | Michael Wood <michael.g.wood@intel.com> | 2015-08-04 22:46:34 +0300 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-08-06 16:04:45 -0500 |
| commit | aff29d2cd837df90a2897b9b75753e4af30f132e (patch) | |
| tree | ed512f81667282dd478b43f3f90c06b05bbcb06f /bitbake/lib/toaster/toastergui/static/js/base.js | |
| parent | 73367c2ca82143c618a22f9faaa101761f192397 (diff) | |
| download | poky-aff29d2cd837df90a2897b9b75753e4af30f132e.tar.gz | |
bitbake: toastergui: Switch to using the new toaster typeahead widget
Switch the existing typeahead inputs to use the new typeahead widget.
This means we have a defined mechanism and end point for typeaheads
which meets the design specification.
(Bitbake rev: 31a8ae7909347f7b6edde5bbdf02b86dc1b32ed0)
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster/toastergui/static/js/base.js')
| -rw-r--r-- | bitbake/lib/toaster/toastergui/static/js/base.js | 26 |
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 */ |
