[commit: haddock] ghc-head, ghc-head1, master, wip/T14529, wip/revert-ttg-2017-11-20, wip/ttg-2017-11-06, wip/ttg2-2017-11-10, wip/ttg3-2017-11-12, wip/ttg4-constraints-2017-11-13, wip/ttg6-unrevert-2017-11-22: Make trigger link configurable (#678) (fe4c6c7)

git at git.haskell.org git at git.haskell.org
Tue Nov 28 11:54:52 UTC 2017


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

On branches: ghc-head,ghc-head1,master,wip/T14529,wip/revert-ttg-2017-11-20,wip/ttg-2017-11-06,wip/ttg2-2017-11-10,wip/ttg3-2017-11-12,wip/ttg4-constraints-2017-11-13,wip/ttg6-unrevert-2017-11-22
Link       : http://git.haskell.org/haddock.git/commitdiff/fe4c6c7d2907a79118d836e72c0442d666091524

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

commit fe4c6c7d2907a79118d836e72c0442d666091524
Author: Alexander Biehl <alexbiehl at gmail.com>
Date:   Fri Sep 1 13:03:49 2017 +0200

    Make trigger link configurable (#678)
    
    QuickNav: Configurable show/hide trigger


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

fe4c6c7d2907a79118d836e72c0442d666091524
 haddock-api/resources/html/index.js | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/haddock-api/resources/html/index.js b/haddock-api/resources/html/index.js
index da30c43..0c2a3c8 100644
--- a/haddock-api/resources/html/index.js
+++ b/haddock-api/resources/html/index.js
@@ -1,6 +1,7 @@
 quickNav = (function() {
 
 var baseUrl;
+var showHideTrigger;
 
 // alias preact's hyperscript reviver since it's referenced a lot:
 var h = preact.h;
@@ -195,7 +196,7 @@ var App = createClass({
   },
 
   componentDidMount: function() {
-    addSearchPageMenuButton(this.toggleVisibility.bind(this));
+    showHideTrigger(this.toggleVisibility.bind(this));
   },
 
   render: function(props, state) {
@@ -384,8 +385,9 @@ var NoResultsMsg = function(props) {
 };
 
 return {
-  init: function(docBaseUrl) {
+  init: function(docBaseUrl, showHide) {
     baseUrl = docBaseUrl || ".";
+    showHideTrigger = showHide || addSearchPageMenuButton
     preact.render(h(App), document.body);
   }
 }



More information about the ghc-commits mailing list