--- a/web/hdabo/static/hdabo/js/hdabo.js Fri Jul 08 18:13:36 2011 +0200
+++ b/web/hdabo/static/hdabo/js/hdabo.js Fri Jul 08 18:13:54 2011 +0200
@@ -157,6 +157,7 @@
function init_datasheet_events()
{
+ var select_done = false;
// Wikipedia search management (new tag)
$("#wp_search").autocomplete({
source: function( request, response ) {
@@ -183,6 +184,7 @@
select: function(event, ui) {
// Since the event still did not update wp_search's val, we force it.
$("#wp_search").val(ui.item.label);
+ select_done = true;
$("#ok_search").click();
},
minLength: 2,
@@ -193,6 +195,12 @@
$( this ).removeClass( "ui-corner-top" ).addClass( "ui-corner-all" );
}
});
+ $('#wp_search').keyup(function(e){
+ if((e.keyCode==13) && ($("#wp_search").val()!="") && (select_done==false)){
+ add_tag($("#wp_search").val());
+ }
+ select_done = false;
+ });
$("#ok_search").click(function(){
if($("#wp_search").val()!=""){
add_tag($("#wp_search").val());