X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=resources%2Fjquery%2Fjquery.suggestions.js;h=3448b7a61cad60fd2bfcce224b24b7c9e683c1a6;hb=65017a8516c321b47d97f1e0b154d3a9d9b7fd8a;hp=303b18f1c5037cac6220c42f10d5abda4983272f;hpb=ec493cc7508e4741e370cbcd10b59ba636c13113;p=lhc%2Fweb%2Fwiklou.git diff --git a/resources/jquery/jquery.suggestions.js b/resources/jquery/jquery.suggestions.js index 303b18f1c5..3448b7a61c 100644 --- a/resources/jquery/jquery.suggestions.js +++ b/resources/jquery/jquery.suggestions.js @@ -79,13 +79,16 @@ $.suggestions = { * @param {Boolean} delayed Whether or not to delay this by the currently configured amount of time */ update: function ( context, delayed ) { - // Only fetch if the value in the textbox changed and is not empty + // Only fetch if the value in the textbox changed and is not empty, or if the results were hidden // if the textbox is empty then clear the result div, but leave other settings intouched function maybeFetch() { if ( context.data.$textbox.val().length === 0 ) { context.data.$container.hide(); context.data.prevText = ''; - } else if ( context.data.$textbox.val() !== context.data.prevText ) { + } else if ( + context.data.$textbox.val() !== context.data.prevText || + !context.data.$container.is( ':visible' ) + ) { if ( typeof context.config.fetch === 'function' ) { context.data.prevText = context.data.$textbox.val(); context.config.fetch.call( context.data.$textbox, context.data.$textbox.val() );