summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrédéric Péters <fpeters@0d.be>2016-05-17 19:04:49 (GMT)
committerFrédéric Péters <fpeters@0d.be>2016-05-17 19:04:49 (GMT)
commit3517782a8ced44176e2b540786c09b4b455a9e0e (patch)
tree42cb087b8a000c48b44ba11f5034c569122301c9
parentb3aea0ef352084f4fee8bcba7cfc32beb8fd0565 (diff)
downloadtabellio.searchform-3517782a8ced44176e2b540786c09b4b455a9e0e.zip
tabellio.searchform-3517782a8ced44176e2b540786c09b4b455a9e0e.tar.gz
tabellio.searchform-3517782a8ced44176e2b540786c09b4b455a9e0e.tar.bz2
use new thesaurus popup
-rw-r--r--tabellio/searchform/js_macros.pt14
1 files changed, 12 insertions, 2 deletions
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 = $('<a class="add-topic-link" href="#"' + '>Ajouter une matière<' + '/a>');
+ add_topic.prepOverlay({
+ subtype: 'ajax',
+ filter: '#content>*',
+ urlmatch: '.*',
+ urlreplace: '/thesaurus/plone-popup/'
+ });
+ $(add_topic).insertAfter(elem);
+ });
});
})(jQuery);
</script>