aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMateusz Kowalczyk <fuuzetsu@fuuzetsu.co.uk>2015-07-11 14:23:05 +0100
committerMateusz Kowalczyk <fuuzetsu@fuuzetsu.co.uk>2015-07-11 14:35:18 +0100
commit06e0766810779180dbc52d15c0df5a2eaaf1881e (patch)
tree46328eb057b251b5847c7d2b370d5ddcc386debe
parent06e675167cc217d5346d706e0d52af0726710e3d (diff)
Fix expansion icon for user-collapsible sections
Closes #412
-rw-r--r--CHANGES2
-rw-r--r--haddock-api/src/Haddock/Backends/Xhtml/DocMarkup.hs5
-rw-r--r--html-test/ref/Bug335.html6
3 files changed, 8 insertions, 5 deletions
diff --git a/CHANGES b/CHANGES
index ff49b6f5..be829adf 100644
--- a/CHANGES
+++ b/CHANGES
@@ -23,6 +23,8 @@ Changes in version 2.16.1
* Generate hyperlinked source ourselves (#410, part of GSOC 2015)
+ * Fix expansion icon for user-collapsible sections (#412)
+
Changes in version 2.16.0
* Experimental collapsible header support (#335)
diff --git a/haddock-api/src/Haddock/Backends/Xhtml/DocMarkup.hs b/haddock-api/src/Haddock/Backends/Xhtml/DocMarkup.hs
index c23f3f08..3fe74a82 100644
--- a/haddock-api/src/Haddock/Backends/Xhtml/DocMarkup.hs
+++ b/haddock-api/src/Haddock/Backends/Xhtml/DocMarkup.hs
@@ -161,8 +161,9 @@ hackMarkup fmt' h' =
UntouchedDoc d -> (markup fmt $ _doc d, [_meta d])
CollapsingHeader (Header lvl titl) par n nm ->
let id_ = makeAnchorId $ "ch:" ++ fromMaybe "noid:" nm ++ show n
- col' = collapseControl id_ True "caption"
- instTable = (thediv ! collapseSection id_ False [] <<)
+ expanded = False
+ col' = collapseControl id_ expanded "caption"
+ instTable = (thediv ! collapseSection id_ expanded [] <<)
lvs = zip [1 .. ] [h1, h2, h3, h4, h5, h6]
getHeader = fromMaybe caption (lookup lvl lvs)
subCaption = getHeader ! col' << markup fmt titl
diff --git a/html-test/ref/Bug335.html b/html-test/ref/Bug335.html
index 6f3d3820..dbe97422 100644
--- a/html-test/ref/Bug335.html
+++ b/html-test/ref/Bug335.html
@@ -64,7 +64,7 @@ window.onload = function () {pageLoad();setSynopsis("mini_Bug335.html");};
>f</a
> :: ()</p
><div class="doc"
- ><h3 id="control.ch:f0" class="caption collapser" onclick="toggleSection('ch:f0')"
+ ><h3 id="control.ch:f0" class="caption expander" onclick="toggleSection('ch:f0')"
>ExF:</h3
><div id="section.ch:f0" class="hide"
><p
@@ -78,7 +78,7 @@ window.onload = function () {pageLoad();setSynopsis("mini_Bug335.html");};
>g</a
> :: ()</p
><div class="doc"
- ><h3 id="control.ch:g0" class="caption collapser" onclick="toggleSection('ch:g0')"
+ ><h3 id="control.ch:g0" class="caption expander" onclick="toggleSection('ch:g0')"
>ExG:</h3
><div id="section.ch:g0" class="hide"
><pre class="screen"
@@ -118,7 +118,7 @@ window.onload = function () {pageLoad();setSynopsis("mini_Bug335.html");};
><p
>Produced by <a href=""
>Haddock</a
- > version 2.16.0</p
+ > version 2.16.1</p
></div
></body
></html