Skip to content

Commit 6e24b2e

Browse files
committed
Fix fluff search engine
1 parent 4a8bd32 commit 6e24b2e

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

scaladoc-js/src/searchbar/SearchbarComponent.scala

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,27 @@ class SearchbarComponent(engine: SearchbarEngine, inkuireEngine: InkuireDelegate
1717
icon.classList.add("micon")
1818
icon.classList.add(p.kind.take(2))
1919

20+
val resultA = document.createElement("a").asInstanceOf[html.Anchor]
21+
resultA.href = Globals.pathToRoot + p.location
22+
resultA.text = s"${p.fullName}"
23+
24+
val location = document.createElement("span")
25+
location.classList.add("pull-right")
26+
location.classList.add("scaladoc-searchbar-location")
27+
location.textContent = p.description
28+
29+
wrapper.appendChild(resultA)
30+
wrapper.appendChild(location)
31+
wrapper.addEventListener("mouseover", {
32+
case e: MouseEvent => handleHover(wrapper)
33+
})
34+
wrapper
35+
36+
def toHTMLInkuireHack =
37+
val wrapper = document.createElement("div").asInstanceOf[html.Div]
38+
wrapper.classList.add("scaladoc-searchbar-result")
39+
wrapper.classList.add("monospace")
40+
2041
val resultA = document.createElement("a").asInstanceOf[html.Anchor]
2142
resultA.href = Globals.pathToRoot + p.location.drop(21) //TODO change when generating XD
2243
resultA.text = s"${p.fullName}"
@@ -66,7 +87,7 @@ class SearchbarComponent(engine: SearchbarEngine, inkuireEngine: InkuireDelegate
6687
case BySignature(signature) =>
6788
println("Searching")
6889
inkuireEngine.query(query) { (p: PageEntry) =>
69-
resultsDiv.appendChild(p.toHTML)
90+
resultsDiv.appendChild(p.toHTMLInkuireHack)
7091
}
7192
}
7293
}

0 commit comments

Comments
 (0)