diff options
author | Mark Lentczner <markl@glyphic.com> | 2010-08-17 18:19:52 +0000 |
---|---|---|
committer | Mark Lentczner <markl@glyphic.com> | 2010-08-17 18:19:52 +0000 |
commit | 2ba3903b23ef41e3a0b08579f23bb38405b96ab6 (patch) | |
tree | 1b66c6a5a9366b0b178365b4414bfcf2aa46843f /src/Haddock/Backends/Xhtml/Layout.hs | |
parent | d7b77654bc1a36cef5a305429cc015aafcb2d391 (diff) |
clean up collapser logics
javascript code for collapasble sections cleaned up
rewrote class utilities in javascript to be more robust
refactored utilities for generating collapsable sections
made toc be same color as synopsis
module list has needed clear attribute in CSS
Diffstat (limited to 'src/Haddock/Backends/Xhtml/Layout.hs')
-rw-r--r-- | src/Haddock/Backends/Xhtml/Layout.hs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/Haddock/Backends/Xhtml/Layout.hs b/src/Haddock/Backends/Xhtml/Layout.hs index 02146476..1a0feeb4 100644 --- a/src/Haddock/Backends/Xhtml/Layout.hs +++ b/src/Haddock/Backends/Xhtml/Layout.hs @@ -40,6 +40,7 @@ import Haddock.Backends.Xhtml.DocMarkup import Haddock.Backends.Xhtml.Types import Haddock.Backends.Xhtml.Utils import Haddock.Types +import Haddock.Utils (makeAnchorId) import Text.XHtml hiding ( name, title, p, quote ) @@ -154,13 +155,13 @@ subFields = divSubDecls "fields" "Fields" . subDlist subInstances :: String -> [SubDecl] -> Html -subInstances id_ = maybe noHtml wrap . instTable +subInstances nm = maybe noHtml wrap . instTable where wrap = (subSection <<) . (subCaption +++) - instTable = fmap (thediv ! [identifier id_, theclass "show"] <<) . subTable + instTable = fmap (thediv ! collapseSection id_ True [] <<) . subTable subSection = thediv ! [theclass $ "subs instances"] - subCaption = paragraph ! collapser id_ "caption" << "Instances" - + subCaption = paragraph ! collapseControl id_ True "caption" << "Instances" + id_ = makeAnchorId $ "i:" ++ nm subMethods :: [Html] -> Html subMethods = divSubDecls "methods" "Methods" . subBlock |