Changeset - 2f93ca3eab8b
[Not reviewed]
default
0 1 0
Mads Kiilerich - 8 years ago 2017-08-13 17:19:18
mads@kiilerich.com
autocomplete: make autocompleteFormatter compatible with select2

The parameters are different, but select2 and the old YAHOO AutoComplete
library provide/require pretty much the same functionality.

This will allow gradual migration to select2.
1 file changed with 5 insertions and 1 deletions:
0 comments (0 inline, 0 general)
kallithea/public/js/base.js
Show inline comments
 
@@ -1055,7 +1055,11 @@ var autocompleteGravatar = function(res,
 

	
 
// Custom formatter to highlight the matching letters
 
var autocompleteFormatter = function (oResultData, sQuery, sResultMatch) {
 
    var query = sQuery.toLowerCase();
 
    var query;
 
    if (sQuery && sQuery.toLowerCase) // YAHOO AutoComplete
 
        query = sQuery.toLowerCase();
 
    else if (sResultMatch && sResultMatch.term) // select2 - parameter names doesn't match
 
        query = sResultMatch.term.toLowerCase();
 

	
 
    // group
 
    if (oResultData.grname != undefined) {
0 comments (0 inline, 0 general)