diff options
author | Frederic Guillot <fred@kanboard.net> | 2016-12-03 12:56:12 -0500 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2016-12-03 12:56:12 -0500 |
commit | 23d862aef8891130bc7eaeaa25513a9895b44c95 (patch) | |
tree | 85331881d6d36e3e358e3b6eb02ec32cf451648e /assets/js/components/suggest-menu.js | |
parent | 4b22db5400cc5b30696560cd4fc5e44ec845168c (diff) |
Add suggest menu for task ID
Diffstat (limited to 'assets/js/components/suggest-menu.js')
-rw-r--r-- | assets/js/components/suggest-menu.js | 11 |
1 files changed, 7 insertions, 4 deletions
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); } } |