aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Biehl <alexbiehl@gmail.com>2017-09-01 13:03:49 +0200
committerGitHub <noreply@github.com>2017-09-01 13:03:49 +0200
commitfe4c6c7d2907a79118d836e72c0442d666091524 (patch)
tree8d86c3206916bdfb46d8c697b817e7b52cd7874b
parent3e94fb427dce9b23a044ca85b6e066dbc486b5b1 (diff)
Make trigger link configurable (#678)
QuickNav: Configurable show/hide trigger
-rw-r--r--haddock-api/resources/html/index.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/haddock-api/resources/html/index.js b/haddock-api/resources/html/index.js
index da30c434..0c2a3c83 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);
}
}