fix autosubmit for typeahead

This commit is contained in:
Kyle Drake 2014-10-23 20:06:03 -07:00
parent 6e4ad797d5
commit 9584cf9a67
2 changed files with 11 additions and 1 deletions

View file

@ -68,6 +68,8 @@
callback(suggestionObjects) callback(suggestionObjects)
}) })
} }
}).on('typeahead:selected', function(e) {
e.target.form.submit()
}) })
</script> </script>
</body> </body>

View file

@ -122,6 +122,11 @@
#top-bar .invisible a { #top-bar .invisible a {
color: #3B3B3B; color: #3B3B3B;
} }
.hidden {
display:none!important;
visibility:hidden
}
</style> </style>
</head> </head>
<body> <body>
@ -144,7 +149,8 @@
<li> <li>
<form id="search_criteria" onsubmit="getPage(1); return false"> <form id="search_criteria" onsubmit="getPage(1); return false">
<input type="hidden" name="sort_by" value="<%= params[:sort_by] %>"> <input type="hidden" name="sort_by" value="<%= params[:sort_by] %>">
<input class="typeahead" name="tag" type="text" placeholder="Browse by tag..." value="<%= params[:tag] %>" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" dir="auto" /> <input class="typeahead" name="tag" type="text" placeholder="Browse by tag..." value="<%= params[:tag] %>" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" />
<input class="hidden" type="submit" tabindex="-1"/>
</form> </form>
</li> </li>
<li> <li>
@ -210,6 +216,8 @@
callback(suggestionObjects) callback(suggestionObjects)
}) })
} }
}).on('typeahead:selected', function(e) {
e.target.form.submit()
}) })
function toggleFollow(id) { function toggleFollow(id) {