[commit: haddock] master: Fix expansion icon for user-collapsible sections (06e0766)

git at git.haskell.org git at git.haskell.org
Wed Jul 22 08:43:05 UTC 2015


Repository : ssh://git@git.haskell.org/haddock

On branch  : master
Link       : http://git.haskell.org/haddock.git/commitdiff/06e0766810779180dbc52d15c0df5a2eaaf1881e

>---------------------------------------------------------------

commit 06e0766810779180dbc52d15c0df5a2eaaf1881e
Author: Mateusz Kowalczyk <fuuzetsu at fuuzetsu.co.uk>
Date:   Sat Jul 11 14:23:05 2015 +0100

    Fix expansion icon for user-collapsible sections
    
    Closes #412


>---------------------------------------------------------------

06e0766810779180dbc52d15c0df5a2eaaf1881e
 CHANGES                                             | 2 ++
 haddock-api/src/Haddock/Backends/Xhtml/DocMarkup.hs | 5 +++--
 html-test/ref/Bug335.html                           | 6 +++---
 3 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/CHANGES b/CHANGES
index ff49b6f..be829ad 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 c23f3f0..3fe74a8 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 6f3d382..dbe9742 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



More information about the ghc-commits mailing list