Fixed bug #775: Now assigned_to isn't sensitive to acuted characters

stable
Jesús Espino 2014-08-27 12:32:36 +02:00
parent ff27e569f0
commit 7fba53177b
1 changed files with 11 additions and 0 deletions

View File

@ -343,9 +343,20 @@ AssignedToLightboxDirective = (lightboxService, lightboxListNavigationService) -
selectedUser = null selectedUser = null
selectedItem = null selectedItem = null
normalizeString = (string) ->
normalizedString = string
normalizedString = normalizedString.replace("Á", "A").replace("Ä", "A").replace("À", "A")
normalizedString = normalizedString.replace("É", "E").replace("Ë", "E").replace("È", "E")
normalizedString = normalizedString.replace("Í", "I").replace("Ï", "I").replace("Ì", "I")
normalizedString = normalizedString.replace("Ó", "O").replace("Ö", "O").replace("Ò", "O")
normalizedString = normalizedString.replace("Ú", "U").replace("Ü", "U").replace("Ù", "U")
return normalizedString
filterUsers = (text, user) -> filterUsers = (text, user) ->
username = user.full_name_display.toUpperCase() username = user.full_name_display.toUpperCase()
username = normalizeString(username)
text = text.toUpperCase() text = text.toUpperCase()
text = normalizeString(text)
return _.contains(username, text) return _.contains(username, text)
render = (selected, text) -> render = (selected, text) ->