Skip to content

Commit 7287244

Browse files
Alex-Jordanclaude
andcommitted
make a few anchors with role=button activate upon use of spacebar
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
1 parent f3c816b commit 7287244

3 files changed

Lines changed: 14 additions & 3 deletions

File tree

htdocs/js/System/system.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,16 @@
9393
});
9494
}
9595

96+
// Make elements with role="button" activate upon use of the spacebar.
97+
for (const btn of document.querySelectorAll('.spacebar-activatable')) {
98+
btn.addEventListener('keydown', (e) => {
99+
if (e.key === ' ') {
100+
e.preventDefault();
101+
btn.click();
102+
}
103+
});
104+
}
105+
96106
// Turn help boxes into popovers
97107
document.querySelectorAll('.help-popup').forEach((popover) => {
98108
popover.addEventListener('click', (e) => e.preventDefault());

templates/ContentGenerator/CourseAdmin/manage_lti_course_map_form.html.ep

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
%
12
<h2><%= maketext('Manage LTI Course Map') %> <%= $c->helpMacro('AdminManageLTICourseMap') %></h2>
23
<%= form_for current_route, method => 'POST', begin =%>
34
<%= $c->hidden_authen_fields =%>
@@ -30,7 +31,7 @@
3031
</td>
3132
<td class="text-center">
3233
% if ($ltiConfigs->{$_}{LTIVersion} && $ltiConfigs->{$_}{LTIVersion} =~ /^v1p[13]$/) {
33-
<a href="#" role="button" data-bs-toggle="modal"
34+
<a href="#" role="button" class="lti-config-btn spacebar-activatable" data-bs-toggle="modal"
3435
data-bs-target="#<%= $_ %>-config-modal">
3536
<i class="fa-solid fa-circle-question fa-xl"></i>
3637
<span class="visually-hidden"><%= maketext('LTI Configuration') %></span>

templates/ContentGenerator/Instructor/JobManager.html.ep

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,8 +183,8 @@
183183
<div class="d-flex justify-content-between gap-1">
184184
<%= maketext($jobs->{$jobID}{state}) =%>
185185
% if (defined $jobs->{$jobID}{result}) {
186-
<a role="button" class="result-btn" tabindex="0" data-bs-toggle="modal" href="#"
187-
data-bs-target="<%= "#result-$jobID" %>">
186+
<a role="button" class="result-btn spacebar-activatable" data-bs-toggle="modal"
187+
href="#" data-bs-target="<%= "#result-$jobID" %>">
188188
<i class="fa-solid fa-circle-info fa-xl" aria-hidden="true"></i>
189189
<span class="visually-hidden">
190190
<%= maketext('Result for job [_1]', $jobID) %>

0 commit comments

Comments
 (0)