Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Line width and line colors problems in view.html #385

Merged
merged 1 commit into from
Mar 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 3 additions & 8 deletions lms/static/comments.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const FLAKE_COMMENTED_LINE_COLOR = '#fac4c3';
const HOVER_LINE_STYLE = '1px solid #0d0d0f';
const HOVER_LINE_COLOR = '#0d0d0f';


function removeMark(lineElement) {
Expand All @@ -20,13 +20,8 @@ function hoverLine(targets, hover) {
const [lineTarget, addCommentTarget] = targets;
if (lineTarget.dataset && lineTarget.dataset.vimbackground === 'true') {return;}
const commentOpacity = (hover === true) ? '1' : '0';
let parsedColor = hover;
if (hover === true) {
parsedColor = HOVER_LINE_STYLE;
} else if (hover === false) {
parsedColor = 'none';
}
lineTarget.style.border = parsedColor;
const parsedColor = (hover === true) ? HOVER_LINE_COLOR : '';
lineTarget.style.borderColor = parsedColor;
addCommentTarget.style.opacity = commentOpacity;
}

Expand Down
13 changes: 6 additions & 7 deletions lms/static/my.css
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,7 @@ a {
overflow: auto;
padding: 0.75rem;
text-align: center;
border-right: #00000000 8px solid;
border-left: #00000000 8px solid;
border-inline: #00000000 8px solid;
}

.centered {
Expand Down Expand Up @@ -474,6 +473,8 @@ button.our-button-narrow, a.our-button-narrow {
flex-direction: column;
flex-basis: 70vw;
flex-grow: 4;
flex-shrink: 1;
min-width: 0;
}

.code-view-container {
Expand Down Expand Up @@ -897,12 +898,10 @@ code#user-code {
flex-direction: row;
justify-content: start;
cursor: pointer;
min-width: 0;
width: 100%;
/* Nice trick: with flex-grow: 1; and width: 0;
* the line fits the container width
* */
width: 0;
flex-grow: 1;
flex-shrink: 1;
border-inline-start: 1px solid #00000000;
}

.grader-add {
Expand Down
2 changes: 1 addition & 1 deletion lms/templates/exercises.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ <h1 id="exercises-head">{{ _('Exercises') }}</h1>
</div>
<div id="exercises">
{%- for exercise in exercises %}
<div class="exercise" {%- if exercise.grade_color %} style="border-right: 8px solid {{ exercise.grade_color }};" {%- endif -%}>
<div class="exercise" {%- if exercise.grade_color %} style="border-inline-start-color: {{ exercise.grade_color }};" {%- endif -%}>
<div class="right-side {{ direction }}-language">
<div class="exercise-number me-3">{{ exercise['exercise_number'] }}</div>
<div class="exercise-name"><div class="ex-title">{{ exercise['exercise_name'] | e }}</div></div>
Expand Down
Loading