[bitbake-devel] [PATCH 2/4] toaster: projectpage Disable/Enable build input if we have 0 layers

Elliot Smith elliot.smith at intel.com
Fri Nov 13 13:48:35 UTC 2015


From: Michael Wood <michael.g.wood at intel.com>

If we've removed all the layers in the configuration, disable the build
button and build input.

Signed-off-by: Michael Wood <michael.g.wood at intel.com>
Signed-off-by: Elliot Smith <elliot.smith at intel.com>
---
 lib/toaster/toastergui/static/js/projectpage.js | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/lib/toaster/toastergui/static/js/projectpage.js b/lib/toaster/toastergui/static/js/projectpage.js
index e742ef2..ae08d9a 100644
--- a/lib/toaster/toastergui/static/js/projectpage.js
+++ b/lib/toaster/toastergui/static/js/projectpage.js
@@ -175,11 +175,18 @@ function projectPageInit(ctx) {
 
   function updateLayersCount(){
     var count = $("#layers-in-project-list").children().length;
+    var noLayerMsg = $("#no-layers-in-project");
+    var buildInput = $("#build-input");
 
-    if (count === 0)
+
+    if (count === 0) {
+      noLayerMsg.fadeIn();
       $("#no-layers-in-project").fadeIn();
-    else
-      $("#no-layers-in-project").hide();
+      buildInput.attr("disabled", "disabled");
+    } else {
+      noLayerMsg.hide();
+      buildInput.removeAttr("disabled");
+    }
 
     $("#project-layers-count").text(count);
 
-- 
1.9.3

---------------------------------------------------------------------
Intel Corporation (UK) Limited
Registered No. 1134945 (England)
Registered Office: Pipers Way, Swindon SN3 1RJ
VAT No: 860 2173 47

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.




More information about the bitbake-devel mailing list