diff options
| author | Mark Lentczner <markl@glyphic.com> | 2010-08-17 23:06:02 +0000 | 
|---|---|---|
| committer | Mark Lentczner <markl@glyphic.com> | 2010-08-17 23:06:02 +0000 | 
| commit | 960d04affed43d771a94d8179c68e31f515f64ec (patch) | |
| tree | 13cbfaf6be8862c8e6dbbeb94a3d38566c374e3f | |
| parent | 2ba3903b23ef41e3a0b08579f23bb38405b96ab6 (diff) | |
don't collapse entries in module list when clicking on links
| -rw-r--r-- | html/Ocean.std-theme/ocean.css | 9 | ||||
| -rw-r--r-- | src/Haddock/Backends/Xhtml.hs | 19 | 
2 files changed, 18 insertions, 10 deletions
| diff --git a/html/Ocean.std-theme/ocean.css b/html/Ocean.std-theme/ocean.css index 0baa1443..79f43834 100644 --- a/html/Ocean.std-theme/ocean.css +++ b/html/Ocean.std-theme/ocean.css @@ -125,10 +125,6 @@ ul.links li a {    background-image: url(plus.gif);    background-repeat: no-repeat;  } -span.module.collapser, -span.module.expander { -  background-position: 0 0.3em; -}  p.caption.collapser,  p.caption.expander {    background-position: 0 0.4em; @@ -518,6 +514,11 @@ div#style-menu-holder {    clear: right;  } +#module-list span.collapser, +#module-list span.expander { +  background-position: 0 0.3em; +} +  #module-list .package {    float: right;  } diff --git a/src/Haddock/Backends/Xhtml.hs b/src/Haddock/Backends/Xhtml.hs index 8ea55e9b..1ae8b12d 100644 --- a/src/Haddock/Backends/Xhtml.hs +++ b/src/Haddock/Backends/Xhtml.hs @@ -262,12 +262,19 @@ mkNode :: [String] -> String -> ModuleTree -> Html  mkNode ss p (Node s leaf pkg short ts) =    htmlModule +++ shortDescr +++ htmlPkg +++ subtree    where -    modAttrs = case ts of -      [] -> [theclass "module"] -      _ -> collapseControl p True "module" - -    htmlModule = thespan ! modAttrs << -      (if leaf +    modAttrs = case (ts, leaf) of +      (_:_, False) -> collapseControl p True "module" +      (_,   _    ) -> [theclass "module"] + +    cBtn = case (ts, leaf) of +      (_:_, True) -> thespan ! collapseControl p True "" << spaceHtml +      (_,   _   ) -> noHtml +      -- We only need an explicit collapser button when the module name +      -- is also a leaf, and so is a link to a module page. Indeed, the +      -- spaceHtml is a minor hack and does upset the layout a fraction. +       +    htmlModule = thespan ! modAttrs << (cBtn +++ +      if leaf          then ppModule (mkModule (stringToPackageId (fromMaybe "" pkg))                                         (mkModuleName mdl))          else toHtml s | 
