Changeset - d6b3839f3c83
[Not reviewed]
default
0 1 0
Mads Kiilerich - 9 years ago 2016-06-29 16:53:53
madski@unity3d.com
js: in select2 for branches, show early matches first - this will make full branch names show up first, then other prefixes, followed by later matches
1 file changed with 3 insertions and 3 deletions:
0 comments (0 inline, 0 general)
kallithea/public/js/base.js
Show inline comments
 
@@ -1474,13 +1474,13 @@ var branchSort = function(results, conta
 
                return -1;
 
            }
 

	
 
            // Put prefix matches before matches in the line
 
            // Put early (especially prefix) matches before later matches
 
            var aPos = a.text.toLowerCase().indexOf(query.term.toLowerCase()),
 
                bPos = b.text.toLowerCase().indexOf(query.term.toLowerCase());
 
            if (aPos === 0 && bPos !== 0) {
 
            if (aPos < bPos) {
 
                return -1;
 
            }
 
            if (bPos === 0 && aPos !== 0) {
 
            if (bPos < aPos) {
 
                return 1;
 
            }
 

	
0 comments (0 inline, 0 general)