@@ -13,6 +13,27 @@ class SearchbarComponent(engine: SearchbarEngine, inkuireEngine: InkuireDelegate
13
13
wrapper.classList.add(" scaladoc-searchbar-result" )
14
14
wrapper.classList.add(" monospace" )
15
15
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
+
16
37
val resultA = document.createElement(" a" ).asInstanceOf [html.Anchor ]
17
38
resultA.href = Globals .pathToRoot + p.location.drop(21 ) // TODO change when generating XD
18
39
resultA.text = s " ${p.fullName}"
@@ -61,7 +82,7 @@ class SearchbarComponent(engine: SearchbarEngine, inkuireEngine: InkuireDelegate
61
82
case BySignature (signature) =>
62
83
println(" Searching" )
63
84
inkuireEngine.query(query) { (p : PageEntry ) =>
64
- resultsDiv.appendChild(p.toHTML )
85
+ resultsDiv.appendChild(p.toHTMLInkuireHack )
65
86
}
66
87
}
67
88
}
0 commit comments