summaryrefslogtreecommitdiffstats
path: root/external/poky/bitbake/lib/toaster/toastergui/static/js
diff options
context:
space:
mode:
authortakeshi_hoshina <takeshi_hoshina@mail.toyota.co.jp>2020-11-02 11:07:33 +0900
committertakeshi_hoshina <takeshi_hoshina@mail.toyota.co.jp>2020-11-02 11:07:33 +0900
commit1c7d6584a7811b7785ae5c1e378f14b5ba0971cf (patch)
treecd70a267a5ef105ba32f200aa088e281fbd85747 /external/poky/bitbake/lib/toaster/toastergui/static/js
parent4204309872da5cb401cbb2729d9e2d4869a87f42 (diff)
recipes
Diffstat (limited to 'external/poky/bitbake/lib/toaster/toastergui/static/js')
-rw-r--r--external/poky/bitbake/lib/toaster/toastergui/static/js/importlayer.js12
1 files changed, 10 insertions, 2 deletions
diff --git a/external/poky/bitbake/lib/toaster/toastergui/static/js/importlayer.js b/external/poky/bitbake/lib/toaster/toastergui/static/js/importlayer.js
index 29648398..8e2032de 100644
--- a/external/poky/bitbake/lib/toaster/toastergui/static/js/importlayer.js
+++ b/external/poky/bitbake/lib/toaster/toastergui/static/js/importlayer.js
@@ -17,11 +17,15 @@ function importLayerPageInit (ctx) {
var currentLayerDepSelection;
var validLayerName = /^(\w|-)+$/;
+ /* Catch 'disable' race condition between type-ahead started and "input change" */
+ var typeAheadStarted = 0;
+
libtoaster.makeTypeahead(layerDepInput,
libtoaster.ctx.layersTypeAheadUrl,
{ include_added: "true" }, function(item){
currentLayerDepSelection = item;
layerDepBtn.removeAttr("disabled");
+ typeAheadStarted = 1;
});
layerDepInput.on("typeahead:select", function(event, data){
@@ -34,7 +38,10 @@ function importLayerPageInit (ctx) {
// disable the "Add layer" button when the layer input typeahead is empty
// or not in the typeahead choices
layerDepInput.on("input change", function(){
- layerDepBtn.attr("disabled","disabled");
+ if (0 == typeAheadStarted) {
+ layerDepBtn.attr("disabled","disabled");
+ }
+ typeAheadStarted = 0;
});
/* We automatically add "openembedded-core" layer for convenience as a
@@ -50,6 +57,7 @@ function importLayerPageInit (ctx) {
});
layerDepBtn.click(function(){
+ typeAheadStarted = 0;
if (currentLayerDepSelection == undefined)
return;
@@ -77,7 +85,7 @@ function importLayerPageInit (ctx) {
$("#layer-deps-list").append(newLayerDep);
- libtoaster.getLayerDepsForProject(currentLayerDepSelection.layerdetailurl,
+ libtoaster.getLayerDepsForProject(currentLayerDepSelection.xhrLayerUrl,
function (data){
/* These are the dependencies of the layer added as a dependency */
if (data.list.length > 0) {