From c385f1551b5276f2f9aab657dfc46ae5c9bde485 Mon Sep 17 00:00:00 2001 From: Michael Wood Date: Fri, 31 Jul 2015 15:09:18 +0300 Subject: bitbake: toastergui: Change build button popover to a build-button To share the build-button mechanism from the pop over and project topbar build button we now use a build-button class to reference them and share the event handlers. (Bitbake rev: e3c6a00b848a6f147e93c8da46b8a3516499fde8) Signed-off-by: Michael Wood Signed-off-by: Ed Bartosh Signed-off-by: Richard Purdie --- bitbake/lib/toaster/toastergui/static/js/base.js | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'bitbake/lib/toaster/toastergui/static') diff --git a/bitbake/lib/toaster/toastergui/static/js/base.js b/bitbake/lib/toaster/toastergui/static/js/base.js index c99f8cdc54..dda2549698 100644 --- a/bitbake/lib/toaster/toastergui/static/js/base.js +++ b/bitbake/lib/toaster/toastergui/static/js/base.js @@ -42,7 +42,7 @@ function basePageInit(ctx) { $(".build-target-input").length === 1) { newBuildTargetInput = $("#new-build-button .build-target-input"); - newBuildTargetBuildBtn = $("#new-build-button .build-button"); + newBuildTargetBuildBtn = $("#new-build-button").find(".build-button"); _setupNewBuildButton(); newBuildButton.show(); @@ -59,8 +59,9 @@ function basePageInit(ctx) { $('#project .icon-pencil').hide(); } - libtoaster.makeTypeahead(newBuildTargetInput, selectedProject.projectTargetsUrl, { format: "json" }, function (item) { - /* successfully selected a target */ + /* If we have a project setup the typeahead */ + if (selectedProject.projectTargetsUrl){ + libtoaster.makeTypeahead(newBuildTargetInput, selectedProject.projectTargetsUrl, { format: "json" }, function (item) { selectedTarget = item; newBuildTargetBuildBtn.removeAttr("disabled"); }); @@ -81,9 +82,11 @@ function basePageInit(ctx) { return; } - if (!selectedTarget) { - selectedTarget = { name: newBuildTargetInput.val() }; - } + /* We use the value of the input field so as to maintain any command also + * added e.g. core-image-minimal:clean + */ + selectedTarget = { name: newBuildTargetInput.val() }; + /* Fire off the build */ libtoaster.startABuild(selectedProject.projectBuildsUrl, selectedProject.projectId, selectedTarget.name, function(){ -- cgit v1.2.3-54-g00ecf