From a3639ab3529cf25511f944f52b35380527073433 Mon Sep 17 00:00:00 2001 From: Mark Lentczner Date: Sun, 25 Jul 2010 18:47:49 +0000 Subject: 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 --- src/Haddock/Backends/Xhtml/Layout.hs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/Haddock/Backends/Xhtml/Layout.hs') 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 -- cgit v1.2.3