summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/compiler/scala/tools/nsc/doc/html/page/Index.scala14
-rw-r--r--src/compiler/scala/tools/nsc/doc/html/resource/lib/index.js19
-rw-r--r--test/scaladoc/run/SI-6017.scala3
3 files changed, 17 insertions, 19 deletions
diff --git a/src/compiler/scala/tools/nsc/doc/html/page/Index.scala b/src/compiler/scala/tools/nsc/doc/html/page/Index.scala
index 86407fb9a3..2f83741d4e 100644
--- a/src/compiler/scala/tools/nsc/doc/html/page/Index.scala
+++ b/src/compiler/scala/tools/nsc/doc/html/page/Index.scala
@@ -48,10 +48,22 @@ class Index(universe: doc.Universe, val index: doc.Index) extends HtmlPage {
</div>
</body>
+ def letters: NodeSeq = {
+ val xs = index.firstLetterIndex.keys.toSeq
+ xs.sorted map {
+ c => <a target="template" href={ "index/index-" + c + ".html" }>{
+ if (c == '_') '#' else c.toUpper
+ }</a>
+ }
+ }
+
def browser =
<div id="browser" class="ui-layout-west">
<div class="ui-west-center">
- <div id="filter"></div>
+ <div id="filter">
+ <div id="textfilter"></div>
+ <div id="letters">{ letters }</div>
+ </div>
<div class="pack" id="tpl">{
def packageElem(pack: model.Package): NodeSeq = {
<xml:group>
diff --git a/src/compiler/scala/tools/nsc/doc/html/resource/lib/index.js b/src/compiler/scala/tools/nsc/doc/html/resource/lib/index.js
index 1323a06c01..70073b272a 100644
--- a/src/compiler/scala/tools/nsc/doc/html/resource/lib/index.js
+++ b/src/compiler/scala/tools/nsc/doc/html/resource/lib/index.js
@@ -335,8 +335,7 @@ function keyboardScrolldownLeftPane() {
/* Configures the text filter */
function configureTextFilter() {
scheduler.add("init", function() {
- $("#filter").append("<div id='textfilter'><span class='pre'/><span class='input'><input id='index-input' type='text' accesskey='/'/></span><span class='post'/></div>");
- printAlphabet();
+ $("#textfilter").append("<span class='pre'/><span class='input'><input id='index-input' type='text' accesskey='/'/></span><span class='post'/>");
var input = $("#textfilter input");
resizeFilterBlock();
input.bind('keyup', function(event) {
@@ -532,19 +531,3 @@ function kindFilterSync() {
function resizeFilterBlock() {
$("#tpl").css("top", $("#filter").outerHeight(true));
}
-
-function printAlphabet() {
- var html = '<a target="template" href="index/index-_.html">#</a>';
- var c;
- for (c = 'a'; c <= 'z'; c = String.fromCharCode(c.charCodeAt(0) + 1)) {
- html += [
- '<a target="template" href="index/index-',
- c,
- '.html">',
- c.toUpperCase(),
- '</a>'
- ].join('');
- }
- $("#filter").append('<div id="letters">' + html + '</div>');
-}
-
diff --git a/test/scaladoc/run/SI-6017.scala b/test/scaladoc/run/SI-6017.scala
index a4950e48d8..e729dca67d 100644
--- a/test/scaladoc/run/SI-6017.scala
+++ b/test/scaladoc/run/SI-6017.scala
@@ -16,6 +16,9 @@ object Test extends ScaladocModelTest {
val index = IndexModelFactory.makeIndex(universe)
// Because "STAR" and "Star" are different
assert(index.firstLetterIndex('s').keys.toSeq.length == 2)
+
+ val indexPage = new Index(universe, index)
+ assert(indexPage.letters.length == 1)
}
case _ => assert(false)
}