[Pkg-debile-commits] [debile-web] 09/10: Submit the form when an item is selected
Sylvestre Ledru
sylvestre at alioth.debian.org
Tue Aug 27 13:22:36 UTC 2013
This is an automated email from the git hooks/post-receive script.
sylvestre pushed a commit to branch update-usuability
in repository debile-web.
commit 65a448b0842cc689407556bc9cfabe5d3a5ab68d
Author: Sylvestre Ledru <sylvestre at debian.org>
Date: Sun Aug 18 16:30:34 2013 +0200
Submit the form when an item is selected
---
templates/search.html | 29 ++++++++++++++---------------
1 file changed, 14 insertions(+), 15 deletions(-)
diff --git a/templates/search.html b/templates/search.html
index f029b23..399fe9a 100644
--- a/templates/search.html
+++ b/templates/search.html
@@ -5,22 +5,21 @@
<script type=text/javascript>
$SCRIPT_ROOT = {{ request.script_root|tojson|safe }};
</script>
-<!-- <script type="text/javascript">
-source: function( request, response ) {
- $.getJSON($SCRIPT_ROOT + "/_search_package", {
- search: request
- }, response);
-}
-</script>
--->
+
<script type="text/javascript">
+function yourChangeHandler() {
+alert("foo");
+}
$(function() {
- $( "#package" ).autocomplete({
- source: function( request, response ) {
- $.getJSON($SCRIPT_ROOT + "/_search_package", {
- search: request
- }, response);
- }
+ $( "#package" ).autocomplete({
+ source: function( request, response ) {
+ $.getJSON($SCRIPT_ROOT + "/_search_package", {
+ search: request
+ }, response);
+ },
+ select: function(event, ui) {
+ $("#package").val(ui.item.label);
+ $("#searchPackageForm").submit(); }
})
});
</script>
@@ -32,7 +31,7 @@ source: function( request, response ) {
</style>
<table><tr><td>By package</td><td>
-<form>
+<form id="searchPackageForm">
{{form.hidden_tag()}}
<div class="ui-widget"> {{form.package(size=20)}}
<input type="submit" value="Search" /></div>
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-debile/debile-web.git
More information about the Pkg-debile-commits
mailing list