Skip to content

Commit 0e8914c

Browse files
committed
Fix fluff search engine
1 parent 0ca94b0 commit 0e8914c

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
@@ -13,6 +13,27 @@ class SearchbarComponent(engine: SearchbarEngine, inkuireEngine: InkuireDelegate
1313
wrapper.classList.add("scaladoc-searchbar-result")
1414
wrapper.classList.add("monospace")
1515

16+
val resultA = document.createElement("a").asInstanceOf[html.Anchor]
17+
resultA.href = Globals.pathToRoot + p.location
18+
resultA.text = s"${p.fullName}"
19+
20+
val location = document.createElement("span")
21+
location.classList.add("pull-right")
22+
location.classList.add("scaladoc-searchbar-location")
23+
location.textContent = p.description
24+
25+
wrapper.appendChild(resultA)
26+
wrapper.appendChild(location)
27+
wrapper.addEventListener("mouseover", {
28+
case e: MouseEvent => handleHover(wrapper)
29+
})
30+
wrapper
31+
32+
def toHTMLInkuireHack =
33+
val wrapper = document.createElement("div").asInstanceOf[html.Div]
34+
wrapper.classList.add("scaladoc-searchbar-result")
35+
wrapper.classList.add("monospace")
36+
1637
val resultA = document.createElement("a").asInstanceOf[html.Anchor]
1738
resultA.href = Globals.pathToRoot + p.location.drop(21) //TODO change when generating XD
1839
resultA.text = s"${p.fullName}"
@@ -61,7 +82,7 @@ class SearchbarComponent(engine: SearchbarEngine, inkuireEngine: InkuireDelegate
6182
case BySignature(signature) =>
6283
println("Searching")
6384
inkuireEngine.query(query) { (p: PageEntry) =>
64-
resultsDiv.appendChild(p.toHTML)
85+
resultsDiv.appendChild(p.toHTMLInkuireHack)
6586
}
6687
}
6788
}

0 commit comments

Comments
 (0)