diff options
author | Mario Vavti <mario@mariovavti.com> | 2018-04-26 09:05:47 +0200 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2018-04-26 09:05:47 +0200 |
commit | 09666ae8e9d7195c4b839abd9b10ae23ff783558 (patch) | |
tree | c8947d413ed3b5258fe8e25b905d2cac98c034e0 /view/js | |
parent | 953d02e4b7c8ae7e1ccbecb37751936cd23710e0 (diff) | |
parent | fe724acc3b78af5ed86b4bf0ff58bdd9b56356e2 (diff) | |
download | volse-hubzilla-09666ae8e9d7195c4b839abd9b10ae23ff783558.tar.gz volse-hubzilla-09666ae8e9d7195c4b839abd9b10ae23ff783558.tar.bz2 volse-hubzilla-09666ae8e9d7195c4b839abd9b10ae23ff783558.zip |
Merge remote-tracking branch 'mike/master' into dev
Diffstat (limited to 'view/js')
-rw-r--r-- | view/js/autocomplete.js | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/view/js/autocomplete.js b/view/js/autocomplete.js index 76c3fb69e..0a440aa90 100644 --- a/view/js/autocomplete.js +++ b/view/js/autocomplete.js @@ -8,20 +8,20 @@ function contact_search(term, callback, backend_url, type, extra_channels, spine $(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 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(); +// 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 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, @@ -41,9 +41,9 @@ function contact_search(term, callback, backend_url, type, extra_channels, spine 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; - } +// if(data.items.length -1 < data.count) { +// contact_search.cache[bt][lterm] = data.items; +// } var items = data.items.slice(0); items.unshift({taggable:false, text: term, replace: term}); callback(items); |