summaryrefslogtreecommitdiff
path: root/yocto-poky/bitbake/lib/toaster/toastergui/static/js/projectpage.js
diff options
context:
space:
mode:
Diffstat (limited to 'yocto-poky/bitbake/lib/toaster/toastergui/static/js/projectpage.js')
-rw-r--r--yocto-poky/bitbake/lib/toaster/toastergui/static/js/projectpage.js39
1 files changed, 25 insertions, 14 deletions
diff --git a/yocto-poky/bitbake/lib/toaster/toastergui/static/js/projectpage.js b/yocto-poky/bitbake/lib/toaster/toastergui/static/js/projectpage.js
index e742ef291..3013416dd 100644
--- a/yocto-poky/bitbake/lib/toaster/toastergui/static/js/projectpage.js
+++ b/yocto-poky/bitbake/lib/toaster/toastergui/static/js/projectpage.js
@@ -116,6 +116,8 @@ function projectPageInit(ctx) {
addRmLayer(layerObj, true);
/* Reset the text input */
layerAddInput.val("");
+ /* Disable the add layer button*/
+ layerAddBtn.attr("disabled", "disabled");
});
function addRmLayer(layerObj, add){
@@ -143,7 +145,7 @@ function projectPageInit(ctx) {
for (var i in layers){
var layerObj = layers[i];
- var projectLayer = $("<li><a></a><span class=\"icon-trash\" data-toggle=\"tooltip\" title=\"Delete\"></span></li>");
+ var projectLayer = $("<li><a></a><span class=\"icon-trash\" data-toggle=\"tooltip\" title=\"Remove\"></span></li>");
projectLayer.data('layer', layerObj);
projectLayer.children("span").tooltip();
@@ -175,11 +177,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);
@@ -218,17 +227,19 @@ function projectPageInit(ctx) {
var toBuild = "";
freqBuildList.find(":checked").each(function(){
- toBuild += $(this).val();
+ toBuild += $(this).val() + ' ';
});
- libtoaster.startABuild(libtoaster.ctx.projectBuildsUrl, libtoaster.ctx.projectId, toBuild, function(){
- /* Build started */
- window.location.replace(libtoaster.ctx.projectBuildsUrl);
- },
- function(){
- /* Build start failed */
- /* [YOCTO #7995] */
- window.location.replace(libtoaster.ctx.projectBuildsUrl);
+ toBuild = toBuild.trim();
+
+ libtoaster.startABuild(null, toBuild,
+ function(){
+ /* Build request started */
+ window.location.replace(libtoaster.ctx.projectBuildsUrl);
+ },
+ function(){
+ /* Build request failed */
+ console.warn("Build request failed to be created");
});
});
@@ -380,7 +391,7 @@ function projectPageInit(ctx) {
/* Layers removed */
if (layersToRm && layersToRm.length > 0){
if (layersToRm.length == 1)
- li = '<li><strong>1</strong> layer deleted: '+layersToRm[0].name+'</li>';
+ li = '<li><strong>1</strong> layer removed: '+layersToRm[0].name+'</li>';
else
li = '<li><strong>'+layersToRm.length+'</strong> layers deleted: '+layersDelList+'</li>';