Skip to content

Commit b396d86

Browse files
committed
Apply requested changes
1 parent 35aefbe commit b396d86

File tree

3 files changed

+19
-23
lines changed

3 files changed

+19
-23
lines changed

scaladoc-js/src/versions-dropdown/DropdownHandler.scala

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,10 @@ class DropdownHandler:
5656
case json =>
5757
addVersionsList(json)
5858

59-
60-
document.onclick = (e: Event) => {
59+
document.addEventListener("click", (e: Event) => {
6160
if e.target.asInstanceOf[html.Element].id != "dropdown-button" then
6261
document.getElementById("dropdown-content").classList.remove("show")
63-
}
62+
})
6463

6564
document.getElementById("version").asInstanceOf[html.Span].onclick = (e: Event) => {
6665
e.stopPropagation
@@ -78,11 +77,13 @@ def filterFunction() =
7877
val input = document.getElementById("dropdown-input").asInstanceOf[html.Input]
7978
val filter = input.value.toUpperCase
8079
val div = document.getElementById("dropdown-content")
81-
val a = div.getElementsByTagName("a")
82-
for i <- 0 until a.length do
83-
val txtValue = a(i).innerText
84-
val disp = if txtValue.toUpperCase.indexOf(filter) > -1 then
85-
""
80+
val as = div.getElementsByTagName("a")
81+
82+
as.foreach { a =>
83+
val txtValue = a.innerText
84+
val cl = a.asInstanceOf[html.Anchor].classList
85+
if txtValue.toUpperCase.indexOf(filter) > -1 then
86+
cl.remove("filtered")
8687
else
87-
"none"
88-
a(i).asInstanceOf[html.Anchor].style.display = disp
88+
cl.add("filtered")
89+
}

scaladoc/resources/dotty_res/styles/scalastyle.css

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -842,17 +842,12 @@ footer {
842842
/* Change color of dropdown links on hover */
843843
.dropdown-content a:hover {background-color: #f1f1f1}
844844

845-
.arrow-down {
846-
content: "\e903"; /* arrow down */
847-
font-family: "dotty-icons" !important;
848-
font-size: 20px;
849-
line-height: var(--leftbar-font-size);
850-
color: var(--leftbar-fg);
851-
display: flex;
852-
flex-direction: row;
853-
align-items: center;
854-
justify-content: center;
845+
/* Show the dropdown menu (use JS to add this class to the .dropdown-content container when the user clicks on the dropdown button) */
846+
.show {
847+
display:block;
855848
}
856849

857-
/* Show the dropdown menu (use JS to add this class to the .dropdown-content container when the user clicks on the dropdown button) */
858-
.show {display:block;}
850+
/* Filtered entries in dropdown menu */
851+
.dropdown-content a.filtered {
852+
display: none;
853+
}

scaladoc/src/dotty/tools/scaladoc/SourceLinks.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ object SourceLinks:
125125
| €{FILE_PATH}, and €{FILE_LINE} patterns
126126
|
127127
|
128-
|Template can defined only by subset of sources defined by path prefix represented by `<sub-path>`.
128+
|Template can be defined only by subset of sources defined by path prefix represented by `<sub-path>`.
129129
|In such case paths used in templates will be relativized against `<sub-path>`""".stripMargin
130130

131131
def load(config: Seq[String], revision: Option[String], projectRoot: Path = Paths.get("").toAbsolutePath)(using CompilerContext): SourceLinks =

0 commit comments

Comments
 (0)