diff options
author | Li Haoyi <haoyi@dropbox.com> | 2014-10-27 00:34:07 -0700 |
---|---|---|
committer | Li Haoyi <haoyi@dropbox.com> | 2014-10-27 00:34:07 -0700 |
commit | b968a31d80490f624ce517a23b83e3cff60b6d95 (patch) | |
tree | 714b5015104ae3b56a45680187420de22c70b880 /book/src/main/scala | |
parent | 6987ac5195b0112b4bda123f0fced3ace7115932 (diff) | |
download | hands-on-scala-js-b968a31d80490f624ce517a23b83e3cff60b6d95.tar.gz hands-on-scala-js-b968a31d80490f624ce517a23b83e3cff60b6d95.tar.bz2 hands-on-scala-js-b968a31d80490f624ce517a23b83e3cff60b6d95.zip |
most things work, scrollspy looks pretty
Diffstat (limited to 'book/src/main/scala')
-rw-r--r-- | book/src/main/scala/book/Book.scala | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/book/src/main/scala/book/Book.scala b/book/src/main/scala/book/Book.scala index d301824..1798713 100644 --- a/book/src/main/scala/book/Book.scala +++ b/book/src/main/scala/book/Book.scala @@ -16,17 +16,21 @@ object Book { val intro = twf("book/intro.tw") val gettingStarted = twf("book/getting-started.tw") val contentBar = { - def rec(current: Node, depth: Int): Frag = { - div( - marginLeft := s"${depth * 5}px", - a(current.name, href:="#"+Utils.munge(current.name)), - current.children.map( - rec(_, depth + 1) + def rec(current: Node, depth: Int): Seq[Frag] = Seq( + li( + a( + current.name, + href:="#"+Utils.munge(current.name), + paddingLeft := s"${depth * 5}px", + cls := "menu-item" ) ) - } + ) ++ current.children.flatMap( + rec(_, depth + 1) + ) + // @li(cls:="menu-item-divided pure-menu-selected") - ul(rec(Utils.structure, 0)) + rec(Utils.structure, 0) } |