aboutsummaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorMichael Wood <michael.g.wood@intel.com>2016-10-05 17:08:52 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-10-06 11:41:48 +0100
commit8df56061f63b63b77a0c7a7ddd75812e3b5a88c4 (patch)
tree2dcc9498e3fe3d345476659122ffee0d61a32110 /bitbake
parent5e9b40556713dc41090497f3c3d9c6a8d6b83b59 (diff)
downloadopenembedded-core-contrib-8df56061f63b63b77a0c7a7ddd75812e3b5a88c4.tar.gz
bitbake: toaster: importlayer Fix layer dependencies button state toggle
Fix regression introduced by switching typeahead library. Make sure we enable and disable the add button based on whether the selection event has fired or not. [YOCTO #9936] (Bitbake rev: cfef79e98b023252cd116d6cc4f90d261d47d13f) Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: bavery <brian.avery@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/toaster/toastergui/static/js/importlayer.js30
1 files changed, 5 insertions, 25 deletions
diff --git a/bitbake/lib/toaster/toastergui/static/js/importlayer.js b/bitbake/lib/toaster/toastergui/static/js/importlayer.js
index 570ca3369b..30dc28280e 100644
--- a/bitbake/lib/toaster/toastergui/static/js/importlayer.js
+++ b/bitbake/lib/toaster/toastergui/static/js/importlayer.js
@@ -21,21 +21,11 @@ function importLayerPageInit (ctx) {
libtoaster.ctx.layersTypeAheadUrl,
{ include_added: "true" }, function(item){
currentLayerDepSelection = item;
+ layerDepBtn.removeAttr("disabled");
});
- // choices available in the typeahead
- var layerDepsChoices = {};
-
- // when the typeahead choices change, store an array of the available layer
- // choices locally, to use for enabling/disabling the "Add layer" button
- layerDepInput.on("typeahead-choices-change", function (event, data) {
- layerDepsChoices = {};
-
- if (data.choices) {
- data.choices.forEach(function (item) {
- layerDepsChoices[item.name] = item;
- });
- }
+ layerDepInput.on("typeahead:select", function(event, data){
+ currentLayerDepSelection = data;
});
// Disable local dir repo when page is loaded.
@@ -43,18 +33,8 @@ 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 () {
- // get the choices from the typeahead
- var choice = layerDepsChoices[$(this).val()];
-
- if (choice) {
- layerDepBtn.removeAttr("disabled");
- currentLayerDepSelection = choice;
- }
- else {
- layerDepBtn.attr("disabled","disabled");
- currentLayerDepSelection = undefined;
- }
+ layerDepInput.on("input change", function(){
+ layerDepBtn.attr("disabled","disabled");
});
/* We automatically add "openembedded-core" layer for convenience as a