Skip to content

Commit

Permalink
Fix layout recomputation
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Sep 24, 2024
1 parent 725b8f4 commit 0f524cf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
7 changes: 6 additions & 1 deletion util/gh-pages/index_template.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ <h1>Clippy Lints</h1> {# #}
Sorry, this site only works with JavaScript! :( {# #}
</div> {# #}
</noscript> {# #}
<script src="script.js"></script> {# #}

<div> {# #}
<div class="panel panel-default"> {# #}
Expand Down Expand Up @@ -144,7 +145,6 @@ <h1>Clippy Lints</h1> {# #}
</div> {# #}
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.6.0/highlight.min.js"></script> {# #}
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.6.0/languages/rust.min.js"></script> {# #}
<script src="script.js"></script>
{% for lint in lints %}
<article class="panel panel-default collapsed" id="{{lint.id}}"> {# #}
<header class="panel-heading" onclick="expandLint('{{lint.id}}')"> {# #}
Expand Down Expand Up @@ -197,6 +197,11 @@ <h2 class="panel-title"> {# #}
</article>
{% endfor %}
</div> {# #}
<script>
generateSettings(); {# #}
generateSearch(); {# #}
parseURLFilters(); {# #}
</script> {# #}
</div> {# #}

<a {#+ #}
Expand Down
6 changes: 2 additions & 4 deletions util/gh-pages/script.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
window.searchState = {
timeout: null,
inputElem: document.getElementById("search-input"),
inputElem: null,
lastSearch: '',
clearInput: () => {
searchState.inputElem.value = "";
Expand Down Expand Up @@ -513,6 +513,7 @@ function generateSettings() {
}

function generateSearch() {
searchState.inputElem = document.getElementById("search-input");
searchState.inputElem.addEventListener("change", handleInputChanged);
searchState.inputElem.addEventListener("input", handleInputChanged);
searchState.inputElem.addEventListener("keydown", handleInputChanged);
Expand Down Expand Up @@ -571,9 +572,6 @@ document.getElementById("disable-shortcuts").checked = disableShortcuts;
document.addEventListener("keypress", handleShortcut);
document.addEventListener("keydown", handleShortcut);

generateSettings();
generateSearch();
parseURLFilters();
window.addEventListener('DOMContentLoaded', () => {
scrollToLintByURL();
filters.filterLints();
Expand Down

0 comments on commit 0f524cf

Please sign in to comment.