Skip to content

Commit

Permalink
approve record keyboard shortcut.
Browse files Browse the repository at this point in the history
  • Loading branch information
bengarrett committed Dec 17, 2024
1 parent a18e654 commit ec454a8
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
8 changes: 8 additions & 0 deletions assets/js/editor-assets.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,15 @@ import { getElmById } from "./helper.mjs";
const emulateEditor = "F11";
const deleteEditor = "Delete";
const closeEditors = "F12";
const approveRecord = "ArrowDown";
let approve = document.getElementById("editor-online-true");
switch (event.key) {
case approveRecord:
if (approve) {
event.preventDefault();
approve.click();
}
break;
case refresher:
event.preventDefault();
location.reload();
Expand Down
2 changes: 1 addition & 1 deletion public/js/editor-assets.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion view/app/artifactlock.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<p class="{{$alertCls}} text-primary-emphasis" id="record-is-hidden">
⛔ This new record is hidden from public access.<br>
{{- if eq $disableApproval ""}}
If the data and images are correct, <a href="#" hx-get="/editor/online/true/{{$modID}}" hx-target="#record-is-hidden">it can be approved</a>.
<span data-bs-toggle="tooltip" data-bs-title="alt + shift + DownArrow">If the data and images are correct, <a href="#" id="editor-online-true" hx-get="/editor/online/true/{{$modID}}" hx-target="#record-is-hidden">it can be approved</a>.</span>
{{- end}}
</p>
{{- else}}
Expand Down

0 comments on commit ec454a8

Please sign in to comment.