diff options
Diffstat (limited to 'bitbake')
-rw-r--r-- | bitbake/lib/toaster/toastergui/static/js/importlayer.js | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/bitbake/lib/toaster/toastergui/static/js/importlayer.js b/bitbake/lib/toaster/toastergui/static/js/importlayer.js index e9d7ae8ef2..df48e84876 100644 --- a/bitbake/lib/toaster/toastergui/static/js/importlayer.js +++ b/bitbake/lib/toaster/toastergui/static/js/importlayer.js | |||
@@ -28,9 +28,11 @@ function importLayerPageInit (ctx) { | |||
28 | /* We automatically add "openembedded-core" layer for convenience as a | 28 | /* We automatically add "openembedded-core" layer for convenience as a |
29 | * dependency as pretty much all layers depend on this one | 29 | * dependency as pretty much all layers depend on this one |
30 | */ | 30 | */ |
31 | $.getJSON(libtoaster.ctx.projectLayersUrl, { include_added: "true" , search: "openembedded-core" }, function(layer) { | 31 | $.getJSON(libtoaster.ctx.projectLayersUrl, |
32 | if (layer.list.length == 1) { | 32 | { include_added: "true" , search: "openembedded-core", format: "json" }, |
33 | currentLayerDepSelection = layer.list[0]; | 33 | function(layer) { |
34 | if (layer.rows.length > 0) { | ||
35 | currentLayerDepSelection = layer.rows[0]; | ||
34 | layerDepBtn.click(); | 36 | layerDepBtn.click(); |
35 | } | 37 | } |
36 | }); | 38 | }); |
@@ -211,16 +213,18 @@ function importLayerPageInit (ctx) { | |||
211 | var name = $(this).val(); | 213 | var name = $(this).val(); |
212 | 214 | ||
213 | /* Check if the layer name exists */ | 215 | /* Check if the layer name exists */ |
214 | $.getJSON(libtoaster.ctx.projectLayersUrl, { include_added: "true" , search: name }, function(layer) { | 216 | $.getJSON(libtoaster.ctx.projectLayersUrl, |
215 | if (layer.list.length > 0) { | 217 | { include_added: "true" , search: name, format: "json" }, |
216 | for (var i in layer.list){ | 218 | function(layer) { |
217 | if (layer.list[i].name == name) { | 219 | if (layer.list.length > 0) { |
218 | console.log(layer.list[i]) | 220 | for (var i in layer.list){ |
219 | layerExistsError(layer.list[i]); | 221 | if (layer.list[i].name == name) { |
222 | console.log(layer.list[i]) | ||
223 | layerExistsError(layer.list[i]); | ||
224 | } | ||
225 | } | ||
220 | } | 226 | } |
221 | } | 227 | }); |
222 | } | ||
223 | }); | ||
224 | }); | 228 | }); |
225 | 229 | ||
226 | vcsURLInput.on('input', function() { | 230 | vcsURLInput.on('input', function() { |