Skip to content
This repository was archived by the owner on Feb 14, 2022. It is now read-only.

Commit ae39ba8

Browse files
committed
Limit suggestions section height
1 parent f7ed68e commit ae39ba8

2 files changed

Lines changed: 14 additions & 2 deletions

File tree

content.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -285,8 +285,11 @@ function addLevelIndicators() {
285285
var standard = (difficultyVotes.length > 0 && difficultyVotes[0].user_id == "solvedac")
286286

287287
getPrefs('hide_other_votes', (hideOtherVotes) => {
288-
if (!document.querySelector(".label-success") && user.user_id !== "solvedac") return
288+
if (!document.querySelector(".label-success") && nick !== "solvedac") return
289289
if (levelData.level != 0 && !standard) {
290+
var difficultyVotesContainer = document.createElement("div");
291+
difficultyVotesContainer.className = "difficulty_vote_container"
292+
290293
for (var i = 0; i < difficultyVotes.length; i++) {
291294
var vote = difficultyVotes[i]
292295
if (vote.user_id === nick) {
@@ -328,9 +331,11 @@ function addLevelIndicators() {
328331
}
329332
difficultyVote.appendChild(voteComment)
330333

331-
problemInfo.appendChild(difficultyVote)
334+
difficultyVotesContainer.appendChild(difficultyVote)
332335
}
333336
}
337+
338+
problemInfo.appendChild(difficultyVotesContainer)
334339
}
335340

336341
if (standard) {

css/override-commons.css

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@
1414
margin-top: 16px;
1515
}
1616

17+
.difficulty_vote_container {
18+
overflow-x: hidden;
19+
overflow-y: auto;
20+
max-height: 180px;
21+
}
22+
1723
#problem_difficulty span.vote_caption {
1824
display: block;
1925
font-weight: bold;
@@ -61,6 +67,7 @@
6167
.algorithm_tag {
6268
display: inline-block;
6369
background: #e5e5e5;
70+
color: #000;
6471
padding: 0 4px;
6572
margin-left: 4px;
6673
font-size: .9em;

0 commit comments

Comments
 (0)