From c42f1cc81dda06ee39d1f0dd76a14da17b9c7f54 Mon Sep 17 00:00:00 2001 From: Michael Wood Date: Thu, 26 May 2016 16:12:24 +0100 Subject: bitbake: toaster: table.js Add the ability to highlight a particular row As in the old build tables it's useful to jump and highlight a particular row in the table using the #hash in the URL. (Bitbake rev: 927bfc26ffcb0eb6c0a5b3c0905b7efc2f19b9a2) Signed-off-by: Michael Wood Signed-off-by: Richard Purdie --- bitbake/lib/toaster/toastergui/static/js/table.js | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'bitbake') diff --git a/bitbake/lib/toaster/toastergui/static/js/table.js b/bitbake/lib/toaster/toastergui/static/js/table.js index 749eb8e75c..7b55102546 100644 --- a/bitbake/lib/toaster/toastergui/static/js/table.js +++ b/bitbake/lib/toaster/toastergui/static/js/table.js @@ -170,6 +170,15 @@ function tableInit(ctx){ table.css("padding-bottom", 0); tableContainer.css("visibility", "visible"); + /* If we have a hash in the url try and highlight that item in the table */ + if (window.location.hash){ + var highlight = $("table a[name="+window.location.hash.replace('#','')); + if (highlight.length > 0){ + highlight.parents("tr").addClass('highlight'); + window.scroll(0, highlight.position().top - 50); + } + } + table.trigger("table-done", [tableData.total, tableParams]); } -- cgit v1.2.3-54-g00ecf