]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
toaster: table.js Add the ability to highlight a particular row
authorMichael Wood <michael.g.wood@intel.com>
Thu, 26 May 2016 15:12:24 +0000 (16:12 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 13 Jun 2016 21:04:30 +0000 (22:04 +0100)
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.

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
lib/toaster/toastergui/static/js/table.js

index 749eb8e75c2f6213c523c1f8de3bf919f9142631..7b551025463f5184c1fe87e58653b010e9383a94 100644 (file)
@@ -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]);
   }