Commit 4ec7854562adde8a90653353de6e7b7be07bcb4d
1 parent
cf84fb2f
commit
Showing
1 changed file
with
6 additions
and
3 deletions
400-SOURCECODE/AIAHTML5.Web/app/filters/AIAFilter.js
1 | -app.filter('startsWithLetter', function () { | |
1 | +AIA.filter('startsWithLetter', function () { | |
2 | 2 | return function (items, letter) { |
3 | + | |
3 | 4 | var filtered = []; |
4 | - var letterMatch = new RegExp(letter, 'i'); | |
5 | + var letterMatch = new RegExp("^" + letter._TermText, 'i'); | |
5 | 6 | for (var i = 0; i < items.length; i++) { |
6 | 7 | var item = items[i]; |
7 | - if (letterMatch.test(item.name.substring(0, 1))) { | |
8 | + //if (letterMatch.test(item._TermText.substring(0, 1))) { | |
9 | + if (letterMatch.test(item._TermText)) { | |
10 | + | |
8 | 11 | filtered.push(item); |
9 | 12 | } |
10 | 13 | } | ... | ... |