aboutsummaryrefslogtreecommitdiff
path: root/haddock-api/resources
diff options
context:
space:
mode:
authorAlexander Biehl <abiehl@novomind.com>2017-08-29 11:40:19 +0200
committerAlexander Biehl <abiehl@novomind.com>2017-08-29 11:40:19 +0200
commiteb88b014c33e5a3d36e7b44885940f70289c00bf (patch)
treebffeddccc2e89750aa66021440a3cf1d96523bfb /haddock-api/resources
parent24ccb9b706e3555bf06f35e2f4007565d76fa1b8 (diff)
QuickNav: Make docbase configurable
Diffstat (limited to 'haddock-api/resources')
-rw-r--r--haddock-api/resources/html/index.js14
1 files changed, 12 insertions, 2 deletions
diff --git a/haddock-api/resources/html/index.js b/haddock-api/resources/html/index.js
index 6d5b2bfc..109a106b 100644
--- a/haddock-api/resources/html/index.js
+++ b/haddock-api/resources/html/index.js
@@ -1,3 +1,7 @@
+quickNav = (function() {
+
+var baseUrl;
+
// alias preact's hyperscript reviver since it's referenced a lot:
var h = preact.h;
@@ -256,7 +260,7 @@ var App = createClass({
var renderItem = function(item) {
return h('li', { class: 'search-result' },
- this.navigationLink(item.link, {},
+ this.navigationLink(baseUrl + "/" + item.link, {},
h(DocHtml, { html: item.display_html })
)
);
@@ -379,4 +383,10 @@ var NoResultsMsg = function(props) {
return messages[(props.searchString || 'a').charCodeAt(0) % messages.length];
};
-preact.render(h(App), document.body);
+return {
+ init: function(docBaseUrl) {
+ baseUrl = docBaseUrl || "";
+ preact.render(h(App), document.body);
+ }
+}
+})();