Skip to content

Commit aab08ae

Browse files
committed
Fix flutter search box
1 parent c535249 commit aab08ae

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

lib/resources/script.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,12 @@ function initSearch(name) {
100100
'constructor' : 4
101101
};
102102

103-
var baseHref = $('body').data('base-href');
103+
var baseHref = '';
104+
if (!$('body').data('using-base-href')) {
105+
// If we aren't using a base-href flag, we will need to add the relative
106+
// path ourselves.
107+
baseHref = $('body').data('base-href');
108+
}
104109

105110
function findMatches(q) {
106111
var allMatches = []; // list of matches

lib/templates/html/_head.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@
3131
</head>
3232

3333
{{! We don't use <base href>, but we do lookup the htmlBase from javascript. }}
34-
<body data-base-href="{{{htmlBase}}}">
34+
<body data-base-href="{{{htmlBase}}}"
35+
data-using-base-href="{{{useBaseHref}}}">
3536

3637
<div id="overlay-under-drawer"></div>
3738

0 commit comments

Comments
 (0)