]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
toaster: Disable add layer button when input is empty
authorBelen Barros Pena <belen.barros.pena@intel.com>
Wed, 14 Oct 2015 12:43:18 +0000 (13:43 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 16 Oct 2015 13:05:24 +0000 (14:05 +0100)
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>
lib/toaster/toastergui/static/js/projectpage.js

index 30989a016c8fcd6eb6d1bb0fe1edeaf258c32f37..b0fe4510a968fabcd825050a4bbb5ecb52a92c59 100644 (file)
@@ -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;