From 23d862aef8891130bc7eaeaa25513a9895b44c95 Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sat, 3 Dec 2016 12:56:12 -0500 Subject: Add suggest menu for task ID --- assets/js/components/suggest-menu.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'assets/js/components/suggest-menu.js') diff --git a/assets/js/components/suggest-menu.js b/assets/js/components/suggest-menu.js index f1f44eaf..07539d2c 100644 --- a/assets/js/components/suggest-menu.js +++ b/assets/js/components/suggest-menu.js @@ -139,13 +139,16 @@ KB.component('suggest-menu', function(containerElement, options) { return null; } - function fetchItems(trigger, text, value) { - if (typeof value === 'string') { - KB.http.get(value).success(function (response) { + function fetchItems(trigger, text, params) { + if (typeof params === 'string') { + var regex = new RegExp('SEARCH_TERM', 'g'); + var url = params.replace(regex, text); + + KB.http.get(url).success(function (response) { onItemFetched(trigger, text, response); }); } else { - onItemFetched(trigger, text, value); + onItemFetched(trigger, text, params); } } -- cgit v1.2.3