[bitbake-devel] [PATCH 17/22] bitbake: toastergui: Change build button popover to a build-button

Ed Bartosh ed.bartosh at linux.intel.com
Fri Jul 31 12:09:18 UTC 2015


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

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.

Signed-off-by: Michael Wood <michael.g.wood at intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh at linux.intel.com>
---
 lib/toaster/toastergui/static/js/base.js   | 15 +++++++++------
 lib/toaster/toastergui/templates/base.html |  4 ++--
 2 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/lib/toaster/toastergui/static/js/base.js b/lib/toaster/toastergui/static/js/base.js
index c99f8cd..dda2549 100644
--- a/lib/toaster/toastergui/static/js/base.js
+++ b/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(){
diff --git a/lib/toaster/toastergui/templates/base.html b/lib/toaster/toastergui/templates/base.html
index 4c6676c..4bef04f 100644
--- a/lib/toaster/toastergui/templates/base.html
+++ b/lib/toaster/toastergui/templates/base.html
@@ -143,8 +143,8 @@
                 <h6>Recipe(s):</h6>
                 <form>
                   <input type="text" class="input-xlarge build-target-input" placeholder="Type a recipe name" autocomplete="off" data-minLength="1" data-autocomplete="off" data-provide="typeahead" disabled/>
-                  <div>
-                    <button class="btn btn-primary" id="build-button" disabled>Build</button>
+                  <div class="row-fluid">
+                    <button class="btn btn-primary build-button" disabled>Build</button>
                   </div>
                 </form>
               </li>
-- 
2.1.4




More information about the bitbake-devel mailing list