From 58197f345b203f55de202f8c91129e3d381359ed Mon Sep 17 00:00:00 2001 From: Michael Wood Date: Thu, 6 Aug 2015 19:23:49 +0300 Subject: bitbake: toastergui: layerBtn Fix build trigger mechanism The new project page is no longer responsible for triggering the build so add a handler for this in layerBtn which is used in the layerdetails and layers pages. This also removes the conflicting and redundant handler for this in the layerdetails. (Bitbake rev: b4c389443bdd121121fd1d1a9006a9f1f63f186f) Signed-off-by: Michael Wood Signed-off-by: Ed Bartosh Signed-off-by: Richard Purdie --- bitbake/lib/toaster/toastergui/static/js/layerBtn.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'bitbake/lib/toaster/toastergui/static/js/layerBtn.js') diff --git a/bitbake/lib/toaster/toastergui/static/js/layerBtn.js b/bitbake/lib/toaster/toastergui/static/js/layerBtn.js index 4243c2bf01..a0509f9aa3 100644 --- a/bitbake/lib/toaster/toastergui/static/js/layerBtn.js +++ b/bitbake/lib/toaster/toastergui/static/js/layerBtn.js @@ -55,6 +55,19 @@ function layerBtnsInit(ctx) { }); }); + $(".build-recipe-btn").unbind('click'); + $(".build-recipe-btn").click(function(e){ + e.preventDefault(); + var recipe = $(this).data('recipe-name'); + + libtoaster.startABuild(libtoaster.ctx.projectBuildsUrl, + libtoaster.ctx.projectId, recipe, + function(){ + /* Success */ + window.location.replace(libtoaster.ctx.projectBuildsUrl); + }); + }); + /* Setup the initial state of the buttons */ for (var i in ctx.projectLayers){ -- cgit v1.2.3-54-g00ecf