From eaae82a19acaf786b866043ea80107f28e8206b2 Mon Sep 17 00:00:00 2001 From: Elliot Smith Date: Fri, 15 Jan 2016 13:00:55 +0200 Subject: bitbake: toastergui: convert project builds page to ToasterTable Use the all builds ToasterTable as the basis for the project builds ToasterTable. [YOCTO #8738] (Bitbake rev: 87bcfb740dd2d9944e35a2a1f71cbf8ff3b266e9) Signed-off-by: Elliot Smith Signed-off-by: Ed Bartosh Signed-off-by: Richard Purdie --- bitbake/lib/toaster/toastergui/static/js/projecttopbar.js | 9 +++++++++ bitbake/lib/toaster/toastergui/static/js/table.js | 13 ++++++++----- 2 files changed, 17 insertions(+), 5 deletions(-) (limited to 'bitbake/lib/toaster/toastergui/static') diff --git a/bitbake/lib/toaster/toastergui/static/js/projecttopbar.js b/bitbake/lib/toaster/toastergui/static/js/projecttopbar.js index b6ad380c19..58a32a056e 100644 --- a/bitbake/lib/toaster/toastergui/static/js/projecttopbar.js +++ b/bitbake/lib/toaster/toastergui/static/js/projecttopbar.js @@ -7,7 +7,10 @@ function projectTopBarInit(ctx) { var projectName = $("#project-name"); var projectNameFormToggle = $("#project-change-form-toggle"); var projectNameChangeCancel = $("#project-name-change-cancel"); + + // this doesn't exist for command-line builds var newBuildTargetInput = $("#build-input"); + var newBuildTargetBuildBtn = $("#build-button"); var selectedTarget; @@ -42,6 +45,12 @@ function projectTopBarInit(ctx) { $(this).parent().removeClass('active'); }); + if (!newBuildTargetInput.length) { + return; + } + + /* the following only applies for non-command-line projects */ + /* Recipe build input functionality */ if (ctx.numProjectLayers > 0 && ctx.machine){ newBuildTargetInput.removeAttr("disabled"); diff --git a/bitbake/lib/toaster/toastergui/static/js/table.js b/bitbake/lib/toaster/toastergui/static/js/table.js index afe16b5e1b..7ac4ed5859 100644 --- a/bitbake/lib/toaster/toastergui/static/js/table.js +++ b/bitbake/lib/toaster/toastergui/static/js/table.js @@ -33,6 +33,10 @@ function tableInit(ctx){ loadData(tableParams); + // clicking on this set of elements removes the search + var clearSearchElements = $('.remove-search-btn-'+ctx.tableName + + ', .show-all-'+ctx.tableName); + function loadData(tableParams){ $.ajax({ type: "GET", @@ -62,9 +66,9 @@ function tableInit(ctx){ paginationBtns.html(""); if (tableParams.search) - $('.remove-search-btn-'+ctx.tableName).show(); + clearSearchElements.show(); else - $('.remove-search-btn-'+ctx.tableName).hide(); + clearSearchElements.hide(); $('.table-count-' + ctx.tableName).text(tableData.total); tableTotal = tableData.total; @@ -230,9 +234,8 @@ function tableInit(ctx){ } else { /* Not orderable */ - header.addClass("muted"); header.css("font-weight", "normal"); - header.append(col.title+' '); + header.append('' + col.title + ' '); } /* Setup the filter button */ @@ -665,7 +668,7 @@ function tableInit(ctx){ loadData(tableParams); }); - $('.remove-search-btn-'+ctx.tableName).click(function(e){ + clearSearchElements.click(function(e){ e.preventDefault(); tableParams.page = 1; -- cgit v1.2.3-54-g00ecf