Permalink
Browse files

Set search input to readonly state when lunr.js not loaded the index yet

  • Loading branch information...
mbajur committed May 11, 2017
1 parent 1153aee commit f21ce3c4070e85edb3800a12d22322d19df57b03
Showing with 2 additions and 2 deletions.
  1. +2 −2 source/javascripts/search.js
@@ -54,7 +54,7 @@ $(document).ready(function() {
window.location.replace(suggestion.data)
}
})
$('search').autocomplete('disable')
$('#search').attr('readonly', true).autocomplete('disable')
// Setup lunr.js
@@ -69,7 +69,7 @@ $(document).ready(function() {
success: function(data) {
window.lunrData = data;
window.lunrIndex = lunr.Index.load(lunrData.index);
$('search').autocomplete('enable')
$('#search').attr('readonly', false).autocomplete('enable')
}
});
})

0 comments on commit f21ce3c

Please sign in to comment.