Skip to content

Commit 0f524cf

Browse files
Fix layout recomputation
1 parent 725b8f4 commit 0f524cf

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

util/gh-pages/index_template.html

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ <h1>Clippy Lints</h1> {# #}
5555
Sorry, this site only works with JavaScript! :( {# #}
5656
</div> {# #}
5757
</noscript> {# #}
58+
<script src="script.js"></script> {# #}
5859

5960
<div> {# #}
6061
<div class="panel panel-default"> {# #}
@@ -144,7 +145,6 @@ <h1>Clippy Lints</h1> {# #}
144145
</div> {# #}
145146
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.6.0/highlight.min.js"></script> {# #}
146147
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.6.0/languages/rust.min.js"></script> {# #}
147-
<script src="script.js"></script>
148148
{% for lint in lints %}
149149
<article class="panel panel-default collapsed" id="{{lint.id}}"> {# #}
150150
<header class="panel-heading" onclick="expandLint('{{lint.id}}')"> {# #}
@@ -197,6 +197,11 @@ <h2 class="panel-title"> {# #}
197197
</article>
198198
{% endfor %}
199199
</div> {# #}
200+
<script>
201+
generateSettings(); {# #}
202+
generateSearch(); {# #}
203+
parseURLFilters(); {# #}
204+
</script> {# #}
200205
</div> {# #}
201206

202207
<a {#+ #}

util/gh-pages/script.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
window.searchState = {
22
timeout: null,
3-
inputElem: document.getElementById("search-input"),
3+
inputElem: null,
44
lastSearch: '',
55
clearInput: () => {
66
searchState.inputElem.value = "";
@@ -513,6 +513,7 @@ function generateSettings() {
513513
}
514514

515515
function generateSearch() {
516+
searchState.inputElem = document.getElementById("search-input");
516517
searchState.inputElem.addEventListener("change", handleInputChanged);
517518
searchState.inputElem.addEventListener("input", handleInputChanged);
518519
searchState.inputElem.addEventListener("keydown", handleInputChanged);
@@ -571,9 +572,6 @@ document.getElementById("disable-shortcuts").checked = disableShortcuts;
571572
document.addEventListener("keypress", handleShortcut);
572573
document.addEventListener("keydown", handleShortcut);
573574

574-
generateSettings();
575-
generateSearch();
576-
parseURLFilters();
577575
window.addEventListener('DOMContentLoaded', () => {
578576
scrollToLintByURL();
579577
filters.filterLints();

0 commit comments

Comments
 (0)