diff options
Diffstat (limited to 'src/Haddock/Backends/Xhtml')
-rw-r--r-- | src/Haddock/Backends/Xhtml/Layout.hs | 4 | ||||
-rw-r--r-- | src/Haddock/Backends/Xhtml/Utils.hs | 10 |
2 files changed, 7 insertions, 7 deletions
diff --git a/src/Haddock/Backends/Xhtml/Layout.hs b/src/Haddock/Backends/Xhtml/Layout.hs index 3535ba0e..9e45b812 100644 --- a/src/Haddock/Backends/Xhtml/Layout.hs +++ b/src/Haddock/Backends/Xhtml/Layout.hs @@ -163,9 +163,7 @@ subInstances id_ = maybe noHtml wrap . instTable 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_ ++ "')" + subCaption = paragraph ! collapser id_ "caption" << "Instances" subMethods :: [Html] -> Html diff --git a/src/Haddock/Backends/Xhtml/Utils.hs b/src/Haddock/Backends/Xhtml/Utils.hs index 61f0894d..30abfdcd 100644 --- a/src/Haddock/Backends/Xhtml/Utils.hs +++ b/src/Haddock/Backends/Xhtml/Utils.hs @@ -25,7 +25,7 @@ module Haddock.Backends.Xhtml.Utils ( hsep, onclick, - collapsebutton, collapseId, + collapser, collapseId, ) where @@ -182,9 +182,11 @@ linkedAnchor n = anchor ! [href ('#':n)] -- below to a 'plusFile' and the 'display:block;' to a 'display:none;' when we -- use cookies from JavaScript to have a more persistent state. -collapsebutton :: String -> Html -collapsebutton id_ = - image ! [ src "minus.gif", theclass "coll", onclick ("toggle(this,'" ++ id_ ++ "')"), alt "show/hide" ] +collapser :: String -> String -> [HtmlAttr] +collapser id_ classes = [ theclass cs, onclick js ] + where + cs = unwords (words classes ++ ["collapser"]) + js = "toggleSection(this,'" ++ id_ ++ "')" -- A quote is a valid part of a Haskell identifier, but it would interfere with |