Skip to content

Commit afe7e76

Browse files
committed
fix hotkey bug in test view
1 parent 9b3105d commit afe7e76

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

dojo/templates/dojo/view_test.html

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -636,6 +636,7 @@ <h3>Notes</h3>
636636
</div>
637637
{% endblock %}
638638
{% block postscript %}
639+
<script type="application/javascript" src="{% static "jquery.hotkeys/jquery.hotkeys.js" %}"></script>
639640
<script type="text/javascript" src="{% static "jquery-highlight/jquery.highlight.js" %}"></script>
640641
<script type="text/javascript">
641642
var checkbox_count = 0;
@@ -655,18 +656,20 @@ <h3>Notes</h3>
655656
$('div#bulk_edit_menu').removeClass('hidden');
656657
}
657658
}
659+
660+
$(document).on('keypress', null, 'e', function () {
661+
window.location.assign('{% url 'edit_test' test.id %}');
662+
});
663+
664+
$(document).on('keypress', null, 'a', function () {
665+
window.location.assign('{% url 'add_findings' test.id %}');
666+
});
667+
658668
$(function () {
659669
$(document).ready(function(){
660670
$('[data-toggle="tooltip"]').tooltip();
661671
});
662-
$(document).on('keypress', function(e) {
663-
var key = String.fromCharCode(e.which);
664-
if (key =='e') {
665-
window.location.assign('{% url 'edit_test' test.id %}');
666-
} else if (key === 'a') {
667-
window.location.assign('{% url 'add_findings' test.id %}');
668-
}
669-
});
672+
670673
check_checked_finding();
671674
$('#id_status').on('click', function (e) {
672675
var checked = this.checked;

0 commit comments

Comments
 (0)