aboutsummaryrefslogtreecommitdiff
path: root/src/Haddock/Backends
diff options
context:
space:
mode:
authorMark Lentczner <markl@glyphic.com>2010-07-25 18:47:49 +0000
committerMark Lentczner <markl@glyphic.com>2010-07-25 18:47:49 +0000
commita3639ab3529cf25511f944f52b35380527073433 (patch)
treea256dc065c5a03077e6df739296620e94e8f4c57 /src/Haddock/Backends
parent9393846ff6b439bd8f360f1239e79fe684f734ee (diff)
change how collapsing sections are done
make whole .caption be the target improve javascript for class toggling have plus/minus images come from .css, not img tags
Diffstat (limited to 'src/Haddock/Backends')
-rw-r--r--src/Haddock/Backends/Xhtml/Layout.hs10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/Haddock/Backends/Xhtml/Layout.hs b/src/Haddock/Backends/Xhtml/Layout.hs
index 499d058a..3535ba0e 100644
--- a/src/Haddock/Backends/Xhtml/Layout.hs
+++ b/src/Haddock/Backends/Xhtml/Layout.hs
@@ -158,10 +158,14 @@ subFields = divSubDecls "fields" "Fields" . subDlist
subInstances :: String -> [SubDecl] -> Html
-subInstances id_ = divSubDecls "instances" instCaption . instTable
+subInstances id_ = maybe noHtml wrap . instTable
where
- instCaption = collapsebutton id_ +++ " Instances"
- instTable = fmap (thediv ! [identifier id_] <<) . subTable
+ wrap = (subSection <<) . (subCaption +++)
+ instTable = fmap (thediv ! [identifier id_, theclass "show"] <<) . subTable
+ subSection = thediv ! [theclass $ "subs instances"]
+ subCaption = paragraph ! [theclass cs, onclick js] << "Instances"
+ cs = "caption collapser"
+ js = "toggleSection(this,'" ++ id_ ++ "')"
subMethods :: [Html] -> Html