diff options
author | zotlabs <mike@macgirvin.com> | 2018-05-06 20:35:57 -0700 |
---|---|---|
committer | zotlabs <mike@macgirvin.com> | 2018-05-06 20:35:57 -0700 |
commit | 1f8b4b14a465193ba0dd061dd55a170e63aeb9ea (patch) | |
tree | 7d5226a307a62d627ab3c6205cec0b449fa52ccb | |
parent | 464025361403747c2d9519382d2ab0df2147a6a6 (diff) | |
download | volse-hubzilla-1f8b4b14a465193ba0dd061dd55a170e63aeb9ea.tar.gz volse-hubzilla-1f8b4b14a465193ba0dd061dd55a170e63aeb9ea.tar.bz2 volse-hubzilla-1f8b4b14a465193ba0dd061dd55a170e63aeb9ea.zip |
remove the old autocomplete cache mechanism
-rw-r--r-- | view/js/autocomplete.js | 22 |
1 files changed, 1 insertions, 21 deletions
diff --git a/view/js/autocomplete.js b/view/js/autocomplete.js index 2a2d1454a..b61af23f8 100644 --- a/view/js/autocomplete.js +++ b/view/js/autocomplete.js @@ -7,21 +7,6 @@ function contact_search(term, callback, backend_url, type, extra_channels, spine if(spinelement) { $(spinelement).show(); } - // Check if there is a cached result that contains the same information we would get with a full server-side search -// var bt = backend_url+type; -// if(!(bt in contact_search.cache)) contact_search.cache[bt] = {}; - -// var lterm = term.toLowerCase(); // Ignore case -// for(var t in contact_search.cache[bt]) { -// if(lterm.indexOf(t) >= 0) { // A more broad search has been performed already, so use those results -// $(spinelement).hide(); - // Filter old results locally -// var matching = contact_search.cache[bt][t].filter(function (x) { return (x.name.toLowerCase().indexOf(lterm) >= 0 || (typeof x.nick !== 'undefined' && x.nick.toLowerCase().indexOf(lterm) >= 0)); }); // Need to check that nick exists because groups don't have one -// matching.unshift({taggable:false, text: term, replace: term}); -// setTimeout(function() { callback(matching); } , 1); // Use "pseudo-thread" to avoid some problems -// return; -// } -// } var postdata = { start:0, @@ -38,12 +23,7 @@ function contact_search(term, callback, backend_url, type, extra_channels, spine url: backend_url, data: postdata, dataType: 'json', - success: function(data){ - // Cache results if we got them all (more information would not improve results) - // data.count represents the maximum number of items -// if(data.items.length -1 < data.count) { -// contact_search.cache[bt][lterm] = data.items; -// } + success: function(data) { var items = data.items.slice(0); items.unshift({taggable:false, text: term, replace: term}); callback(items); |