Added a bit of javascript and styling to make it possible to use URL fragment identifiers to link to position-specific tabs on the nomocom requirements and questionnaire pages.

- Legacy-Id: 15451
This commit is contained in:
Henrik Levkowetz 2018-09-13 15:50:31 +00:00
parent 9e87dc4b66
commit 4e2b62d126
4 changed files with 49 additions and 1 deletions

View file

@ -117,6 +117,16 @@ div.anchor-target:before {
}
div.anchor-target { z-index: 0; }
/* Same as above (avoid hiding content under navbar) for tab-panes */
div.tab-pane:before {
content: '';
display: block;
position: relative;
width: 0;
height: 7.5em;
margin-top: -7.5em;
}
/* Make the panel title font normally large */
.panel-title { font-size: 14px }
@ -591,7 +601,6 @@ table.simple-table td:last-child {
background-color: #F0F0F0;
}
.reviewer-doc-past {
background-color: #800000;
}

View file

@ -595,4 +595,15 @@
{% endfor %}
</div>
<div>
<script>
// Javascript to enable link to tabs
var url = document.location.toString();
if (url.match('#')) {
$('.nav-tabs a[href="#' + url.split('#')[1] + '"]').tab('show');
}
// Change hash for page-reload
$('.nav-tabs a').on('shown.bs.tab', function (e) {
window.location.hash = e.target.hash;
})
</script>
</body></html>

View file

@ -60,3 +60,17 @@
{% endblock %}
{% endblock %}
{% block js %}
<script>
// Javascript to enable link to tab
var url = document.location.toString();
if (url.match('#')) {
$('.nav-tabs a[href="#' + url.split('#')[1] + '"]').tab('show');
}
// Change hash for page-reload
$('.nav-tabs a').on('shown.bs.tab', function (e) {
window.location.hash = e.target.hash;
})
</script>
{% endblock %}

View file

@ -25,3 +25,17 @@
{% endblock %}
{% endblock %}
{% block js %}
<script>
// Javascript to enable link to tab
var url = document.location.toString();
if (url.match('#')) {
$('.nav-tabs a[href="#' + url.split('#')[1] + '"]').tab('show');
}
// Change hash for page-reload
$('.nav-tabs a').on('shown.bs.tab', function (e) {
window.location.hash = e.target.hash;
})
</script>
{% endblock %}