diff --git a/tabellio/searchform/js_macros.pt b/tabellio/searchform/js_macros.pt index 661f280..d60fca1 100644 --- a/tabellio/searchform/js_macros.pt +++ b/tabellio/searchform/js_macros.pt @@ -67,8 +67,18 @@ if(typeof(String.prototype.trim) === "undefined") { 'cacheLength': 0, 'matchContains': true, 'scroll': true, 'max': 30}).result(autocomplete_ready); $('.polgroup-autocomplete').each(sync_polgroups).autocomplete(PORTAL_URL+'/listPolgroups', { }).result(autocomplete_ready); - $('.topic-autocomplete').each(sync_topics).autocomplete(PORTAL_URL+'/listTopics', { - 'cacheLength': 0, 'matchContains': true, 'scroll': true, 'max': 30}).result(autocomplete_ready); + $('.topic-autocomplete').each(sync_topics); + $('.topic-autocomplete').each(function(index, elem) { + $(elem).hide(); + var add_topic = $('Ajouter une matière<' + '/a>'); + add_topic.prepOverlay({ + subtype: 'ajax', + filter: '#content>*', + urlmatch: '.*', + urlreplace: '/thesaurus/plone-popup/' + }); + $(add_topic).insertAfter(elem); + }); }); })(jQuery);