Skip to content

Commit

Permalink
Tweaks for the PG problem editor for course info files.
Browse files Browse the repository at this point in the history
This wraps the injected course info html in a `div` that has overflow
auto set.  If the course info file has long contents, then those
contents currently extend past the containing div, and this fixes that.

In addition padding and a background color are added to improve the
appearance.  These are the same styles that are used when this is
displayed in the actual info box.
  • Loading branch information
drgrice1 committed Nov 16, 2023
1 parent d5e79fd commit 8bc52de
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion htdocs/js/PGProblemEditor/pgproblemeditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@

if (fileType === 'course_info') {
const contents = webworkConfig?.pgCodeMirror?.getValue();
if (contents) renderArea.innerHTML = contents;
if (contents) renderArea.innerHTML = `<div class="overflow-auto p-2 bg-light h-100">${contents}</div>`;
else
renderArea.innerHTML = '<div class="alert alert-danger p-1 m-2 fw-bold">The file has no content.</div>';

Expand Down

0 comments on commit 8bc52de

Please sign in to comment.