[oe-commits] [bitbake] 13/44: toaster: table.js Add the ability to highlight a particular row

git at git.openembedded.org git at git.openembedded.org
Mon Jun 13 21:11:01 UTC 2016


rpurdie pushed a commit to branch master-next
in repository bitbake.

commit 927bfc26ffcb0eb6c0a5b3c0905b7efc2f19b9a2
Author: Michael Wood <michael.g.wood at intel.com>
AuthorDate: Thu May 26 16:12:24 2016 +0100

    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.
    
    Signed-off-by: Michael Wood <michael.g.wood at intel.com>
---
 lib/toaster/toastergui/static/js/table.js | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/lib/toaster/toastergui/static/js/table.js b/lib/toaster/toastergui/static/js/table.js
index 749eb8e..7b55102 100644
--- a/lib/toaster/toastergui/static/js/table.js
+++ b/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]);
   }
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list