diff options
author | Simon Rettberg | 2021-11-24 15:30:23 +0100 |
---|---|---|
committer | Simon Rettberg | 2022-03-09 15:06:54 +0100 |
commit | 88a49692688114d8fc16896f501d0cc9caa32a1c (patch) | |
tree | 59bc58d133ca3b31e71712912ec723781c12a025 /modules-available/passthrough | |
parent | [statistics] Adapt hw-data parsing to new json format for display (diff) | |
download | slx-admin-88a49692688114d8fc16896f501d0cc9caa32a1c.tar.gz slx-admin-88a49692688114d8fc16896f501d0cc9caa32a1c.tar.xz slx-admin-88a49692688114d8fc16896f501d0cc9caa32a1c.zip |
[passthrough] Show+Highlight device from URL hash (link in statistics)
Diffstat (limited to 'modules-available/passthrough')
-rw-r--r-- | modules-available/passthrough/templates/hardware-list.html | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/modules-available/passthrough/templates/hardware-list.html b/modules-available/passthrough/templates/hardware-list.html index 4bff0a39..4468645c 100644 --- a/modules-available/passthrough/templates/hardware-list.html +++ b/modules-available/passthrough/templates/hardware-list.html @@ -11,7 +11,7 @@ </thead> <tbody> {{#list}} - <tr> + <tr class="c-{{vendor}}-{{device}} tr"> {{#class_name}} <td colspan="4"> <span>{{class}}</span> – <strong>{{class_name}}</strong> @@ -101,5 +101,17 @@ $(this).append($('<option>').attr('value', gid).text(gid + ' (' + title + ')')); }); }); + hashChanged(); + }); + window.addEventListener('hashchange', function() { + hashChanged(); }); + function hashChanged() { + var c = window.location.hash; + $('tr.tr').removeClass('bg-success'); + if (c && c.length > 1) { + var d = $('.c-' + c.substr(1)).addClass('bg-success'); + if (d.length > 0) d[0].scrollIntoView(); + } + } </script>
\ No newline at end of file |