Skip to content

Commit

Permalink
toaster: projectpage Disable/Enable build input if we have 0 layers
Browse files Browse the repository at this point in the history
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@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
  • Loading branch information
Michael Wood authored and rpurdie committed Nov 16, 2015
1 parent a981700 commit 872bd5c
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions lib/toaster/toastergui/static/js/projectpage.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 872bd5c

Please sign in to comment.