# HG changeset patch # User ymh # Date 1310141634 -7200 # Node ID 15fb85252d88710c9878ad4bc14b89f91e50e8a2 # Parent 949e319fbaa09cae34c9820b4746a4d4e57fd08e# Parent 80023516532ff4c9a17f7e513013df8d63cc7a60 Merge with 80023516532ff4c9a17f7e513013df8d63cc7a60 diff -r 949e319fbaa0 -r 15fb85252d88 web/hdabo/static/hdabo/js/hdabo.js --- 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());