Refactor exam scores user template to unify view button class for consistency
This commit is contained in:
@@ -25,7 +25,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="text-end ms-3">
|
<div class="text-end ms-3">
|
||||||
{% if exam.publish_results %}
|
{% if exam.publish_results %}
|
||||||
<button type="button" class="btn btn-sm btn-outline-primary" data-qn={{forloop.counter0}}>View</button>
|
<button type="button" class="btn btn-sm btn-outline-primary view-question-button" data-qn={{forloop.counter0}}>View</button>
|
||||||
{% else %}
|
{% else %}
|
||||||
<button type="button" class="btn btn-sm btn-outline-secondary" disabled>View</button>
|
<button type="button" class="btn btn-sm btn-outline-secondary" disabled>View</button>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@@ -88,7 +88,7 @@
|
|||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
$("#hide-viewer").on('click', function(){ $('.viewer-block .viewer-body').toggle(); });
|
$("#hide-viewer").on('click', function(){ $('.viewer-block .viewer-body').toggle(); });
|
||||||
|
|
||||||
$(".view-question-link").on("click", function (e) {
|
$(".view-question-button").on("click", function (e) {
|
||||||
question_number = e.currentTarget.dataset.qn;
|
question_number = e.currentTarget.dataset.qn;
|
||||||
$("#single-dicom-viewer").empty();
|
$("#single-dicom-viewer").empty();
|
||||||
$.ajax({
|
$.ajax({
|
||||||
@@ -113,8 +113,8 @@
|
|||||||
.always(function () { console.log('[Done]'); });
|
.always(function () { console.log('[Done]'); });
|
||||||
});
|
});
|
||||||
|
|
||||||
// auto-click first view link to populate viewer
|
// auto-click first view button to populate viewer
|
||||||
const firstView = $(".view-question-link").first();
|
const firstView = $(".view-question-button").first();
|
||||||
if(firstView.length){ firstView.click(); }
|
if(firstView.length){ firstView.click(); }
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user