mirror of
https://github.com/thewesker/greptweet.git
synced 2025-12-21 12:41:04 -05:00
Focus on hash
This commit is contained in:
Submodule bootstrap updated: ebc6935663...485e6c9063
@@ -28,8 +28,6 @@
|
||||
|
||||
<div id="results"></div>
|
||||
|
||||
<p class="help-inline">Type a search query like <a href="?foo">foo</a></p>
|
||||
|
||||
<script src="/jquery-1.8.0.min.js"></script>
|
||||
<script async src="/main.js"></script>
|
||||
|
||||
|
||||
7
main.js
7
main.js
@@ -56,7 +56,6 @@ $(document).ready(function() {
|
||||
$("input[type=search]").change(function() {
|
||||
query = this.value;
|
||||
window.location.hash = query;
|
||||
grep(query);
|
||||
});
|
||||
|
||||
if (window.location.search || window.location.hash) {
|
||||
@@ -82,3 +81,9 @@ $(document).ready(function() {
|
||||
|
||||
});
|
||||
|
||||
$(window).bind('hashchange', function() {
|
||||
console.log("Hash change: ", window.location.hash);
|
||||
searchquery = window.location.hash.substr(1);
|
||||
$("input[type=search]").val(searchquery);
|
||||
grep(searchquery);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user