summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBelen Barros Pena <belen.barros.pena@intel.com>2015-10-14 13:43:18 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-10-16 14:05:24 +0100
commitd4820f16c76398400ddd573db03c654c51d40c1b (patch)
treedf9d0b69664238b38a4c8aa212cc8df96791c6e6
parentb5af7084b28158a8a9eaf78db463555ae8e0f620 (diff)
downloadbitbake-d4820f16c76398400ddd573db03c654c51d40c1b.tar.gz
toaster: Disable add layer button when input is empty
The 'add layer' button in the project configuration page is enabled when you select a layer from the type ahead. However, if you delete the layer name, the 'add layer' button remains enabled, and if you click it, the last selected layer from the type ahead will be added to the project. It is probably better to disable the 'add layer' button when the input field is empty. [YOCTO #8449] Signed-off-by: Belen Barros Pena <belen.barros.pena@intel.com> Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--lib/toaster/toastergui/static/js/projectpage.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/toaster/toastergui/static/js/projectpage.js b/lib/toaster/toastergui/static/js/projectpage.js
index 30989a016..b0fe4510a 100644
--- a/lib/toaster/toastergui/static/js/projectpage.js
+++ b/lib/toaster/toastergui/static/js/projectpage.js
@@ -103,6 +103,12 @@ function projectPageInit(ctx) {
layerAddBtn.removeAttr("disabled");
});
+ layerAddInput.keyup(function() {
+ if ($(this).val().length == 0) {
+ layerAddBtn.attr("disabled", "disabled")
+ }
+ });
+
layerAddBtn.click(function(e){
e.preventDefault();
var layerObj = currentLayerAddSelection;