Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Avoid Javascript error
search.js / search_template.js uses jquery for running JS when the
document is ready, but cannot use jQuery for that, because jQuery is lazily
loaded, and thus might not be available yet (#117)
  • Loading branch information
moritz committed Aug 22, 2015
1 parent f451b09 commit 6c72b35
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion template/search_template.js
@@ -1,4 +1,6 @@
$(function(){
// cannot use $(...) here, because jQuery is loaded asynchronously,
// and might not be available yet.
document.addEventListener("DOMContentLoaded", function(event) {
$('#search').css('visibility', 'visible');
$("#query").autocomplete({
position: { my: "right top", at: "right bottom", of: "#search div" },
Expand Down

0 comments on commit 6c72b35

Please sign in to comment.