aboutsummaryrefslogtreecommitdiff
path: root/haddock-api/src/Haddock/Backends/Xhtml/Layout.hs
diff options
context:
space:
mode:
authorAlec Theriault <alec.theriault@gmail.com>2018-11-07 10:22:31 -0800
committerAlec Theriault <alec.theriault@gmail.com>2018-11-07 12:37:18 -0800
commit2a46036ea4e2e6bb6505ebbfd3e4609aeb7c3845 (patch)
treebf069d7d4f2072c100cf5166ffa9f357d0636b3f /haddock-api/src/Haddock/Backends/Xhtml/Layout.hs
parent74f791936f28b175265994494412698e90d0e85f (diff)
Fix issues around plus/minus
* swap the minimize unicode to something more intuitive * use new unicode expander/collapser for instance lists * address some alignment issues in the "index" page
Diffstat (limited to 'haddock-api/src/Haddock/Backends/Xhtml/Layout.hs')
-rw-r--r--haddock-api/src/Haddock/Backends/Xhtml/Layout.hs7
1 files changed, 4 insertions, 3 deletions
diff --git a/haddock-api/src/Haddock/Backends/Xhtml/Layout.hs b/haddock-api/src/Haddock/Backends/Xhtml/Layout.hs
index 10a6d499..c935bc5f 100644
--- a/haddock-api/src/Haddock/Backends/Xhtml/Layout.hs
+++ b/haddock-api/src/Haddock/Backends/Xhtml/Layout.hs
@@ -195,17 +195,18 @@ subEquations :: Maybe Package -> Qualification -> [SubDecl] -> Html
subEquations pkg qual = divSubDecls "equations" "Equations" . subTable pkg qual
--- | Generate sub table for instance declarations, with source
+-- | Generate collapsible sub table for instance declarations, with source
subInstances :: Maybe Package -> Qualification
-> String -- ^ Class name, used for anchor generation
-> LinksInfo -> Bool
-> [(SubDecl, Maybe Module, Located DocName)] -> Html
subInstances pkg qual nm lnks splice = maybe noHtml wrap . instTable
where
- wrap contents = subSection (collapseDetails id_ DetailsOpen (summary +++ contents))
+ wrap contents = subSection (hdr +++ collapseDetails id_ DetailsOpen (summary +++ contents))
instTable = subTableSrc pkg qual lnks splice
subSection = thediv ! [theclass "subs instances"]
- summary = thesummary << "Instances"
+ hdr = h4 ! collapseControl id_ "instances" << "Instances"
+ summary = thesummary ! [ theclass "hide-when-js-enabled" ] << "Instances details"
id_ = makeAnchorId $ "i:" ++ nm