Skip to content

Commit 50b8734

Browse files
authored
fix: Line width and line colors problems in view.html (#385)
1 parent aaf7370 commit 50b8734

File tree

3 files changed

+10
-16
lines changed

3 files changed

+10
-16
lines changed

lms/static/comments.js

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
const FLAKE_COMMENTED_LINE_COLOR = '#fac4c3';
2-
const HOVER_LINE_STYLE = '1px solid #0d0d0f';
2+
const HOVER_LINE_COLOR = '#0d0d0f';
33

44

55
function removeMark(lineElement) {
@@ -20,13 +20,8 @@ function hoverLine(targets, hover) {
2020
const [lineTarget, addCommentTarget] = targets;
2121
if (lineTarget.dataset && lineTarget.dataset.vimbackground === 'true') {return;}
2222
const commentOpacity = (hover === true) ? '1' : '0';
23-
let parsedColor = hover;
24-
if (hover === true) {
25-
parsedColor = HOVER_LINE_STYLE;
26-
} else if (hover === false) {
27-
parsedColor = 'none';
28-
}
29-
lineTarget.style.border = parsedColor;
23+
const parsedColor = (hover === true) ? HOVER_LINE_COLOR : '';
24+
lineTarget.style.borderColor = parsedColor;
3025
addCommentTarget.style.opacity = commentOpacity;
3126
}
3227

lms/static/my.css

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,7 @@ a {
134134
overflow: auto;
135135
padding: 0.75rem;
136136
text-align: center;
137-
border-right: #00000000 8px solid;
138-
border-left: #00000000 8px solid;
137+
border-inline: #00000000 8px solid;
139138
}
140139

141140
.centered {
@@ -474,6 +473,8 @@ button.our-button-narrow, a.our-button-narrow {
474473
flex-direction: column;
475474
flex-basis: 70vw;
476475
flex-grow: 4;
476+
flex-shrink: 1;
477+
min-width: 0;
477478
}
478479

479480
.code-view-container {
@@ -897,12 +898,10 @@ code#user-code {
897898
flex-direction: row;
898899
justify-content: start;
899900
cursor: pointer;
901+
min-width: 0;
900902
width: 100%;
901-
/* Nice trick: with flex-grow: 1; and width: 0;
902-
* the line fits the container width
903-
* */
904-
width: 0;
905-
flex-grow: 1;
903+
flex-shrink: 1;
904+
border-inline-start: 1px solid #00000000;
906905
}
907906

908907
.grader-add {

lms/templates/exercises.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ <h1 id="exercises-head">{{ _('Exercises') }}</h1>
1010
</div>
1111
<div id="exercises">
1212
{%- for exercise in exercises %}
13-
<div class="exercise" {%- if exercise.grade_color %} style="border-right: 8px solid {{ exercise.grade_color }};" {%- endif -%}>
13+
<div class="exercise" {%- if exercise.grade_color %} style="border-inline-start-color: {{ exercise.grade_color }};" {%- endif -%}>
1414
<div class="right-side {{ direction }}-language">
1515
<div class="exercise-number me-3">{{ exercise['exercise_number'] }}</div>
1616
<div class="exercise-name"><div class="ex-title">{{ exercise['exercise_name'] | e }}</div></div>

0 commit comments

Comments
 (0)