Skip to content
This repository was archived by the owner on Aug 3, 2024. It is now read-only.

Commit fe4c6c7

Browse files
authored
Make trigger link configurable (#678)
QuickNav: Configurable show/hide trigger
1 parent 3e94fb4 commit fe4c6c7

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

haddock-api/resources/html/index.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
quickNav = (function() {
22

33
var baseUrl;
4+
var showHideTrigger;
45

56
// alias preact's hyperscript reviver since it's referenced a lot:
67
var h = preact.h;
@@ -195,7 +196,7 @@ var App = createClass({
195196
},
196197

197198
componentDidMount: function() {
198-
addSearchPageMenuButton(this.toggleVisibility.bind(this));
199+
showHideTrigger(this.toggleVisibility.bind(this));
199200
},
200201

201202
render: function(props, state) {
@@ -384,8 +385,9 @@ var NoResultsMsg = function(props) {
384385
};
385386

386387
return {
387-
init: function(docBaseUrl) {
388+
init: function(docBaseUrl, showHide) {
388389
baseUrl = docBaseUrl || ".";
390+
showHideTrigger = showHide || addSearchPageMenuButton
389391
preact.render(h(App), document.body);
390392
}
391393
}

0 commit comments

Comments
 (0)