Commit 72632e20 authored by Arkadiusz Hiler's avatar Arkadiusz Hiler

series: Improve revision navigation

With this change hash part of the URL is updated when clicking on a
revision to show.

Also providing hash in the URL will navigate straight to that revision
(e.g. /series/1234/#rev3).
Signed-off-by: Arkadiusz Hiler's avatarArkadiusz Hiler <arkadiusz.hiler@intel.com>
parent 4db96855
Pipeline #12666 passed with stage
in 11 minutes and 30 seconds
...@@ -9,6 +9,25 @@ $(function () { ...@@ -9,6 +9,25 @@ $(function () {
pw.setup_series({ patches: 'series-patchlist' }); pw.setup_series({ patches: 'series-patchlist' });
}); });
// improved switching between revision tabs
$(document).ready(function() {
// bootstrap prevents default here,
// let's hand-roll out our own hash update
$('*[data-toggle="pill"]').click(function() {
window.location.hash = $(this).attr('href');
});
// let's got to the the revision indicated by anchor on load
var hash = window.location.hash.substr(1);
$("#select_"+hash).tab("show");
// let's also change the tab if user changes the hash
$(window).on('hashchange', function() {
var hash = window.location.hash.substr(1);
$("#select_"+hash).tab("show");
});
});
$(document).ready(function() { $(document).ready(function() {
{% if is_retestable %} {% if is_retestable %}
$("#retest-latest").click(function(e) { $("#retest-latest").click(function(e) {
...@@ -113,7 +132,7 @@ $(document).ready(function() { ...@@ -113,7 +132,7 @@ $(document).ready(function() {
<ul class="nav nav-pills small-pills" data-tabs="tabs" role="tablist"> <ul class="nav nav-pills small-pills" data-tabs="tabs" role="tablist">
{% for revision in revisions %} {% for revision in revisions %}
<li role="presentation"{% if forloop.last %} class="active"{%endif%}> <li role="presentation"{% if forloop.last %} class="active"{%endif%}>
<a data-toggle="pill" href="#rev{{ revision.version }}">rev {{ revision.version }}</a> <a id="select_rev{{ revision.version }}" data-toggle="pill" href="#rev{{ revision.version }}">rev {{ revision.version }}</a>
</li> </li>
{% endfor %} {% endfor %}
</ul> </ul>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment